<template>
  <div class="project-pavilion" v-title data-title="项目馆">
    <a-affix :offset-top="0">
      <home-nav :userData="userinfo"></home-nav>
      <a-carousel autoplay arrows :autoplaySpeed="10000" :before-change="carouselOnChange" ref="carousel" class="changeHand" title="点击查看">
        <div slot="prevArrow" class="custom-slick-arrow" style="left: 10px; zindex: 1">
          <a-icon type="left-circle" />
        </div>
        <div slot="nextArrow" class="custom-slick-arrow" style="right: 10px">
          <a-icon type="right-circle" />
        </div>
        <div v-for="(item, index) in rotationChartList" :key="index" @click="handleGoFile(item)" :style="{
          backgroundImage: 'url(' + require('@/assets/' + item.name) + ')',
          height: '80px',
          backgroundPosition: 'center',
        }"></div>
      </a-carousel>
    </a-affix>
    <div class="tabs-box" v-infinite-scroll="handleInfiniteOnLoad" :infinite-scroll-disabled="busy"
      :infinite-scroll-distance="100">
      <a-row type="flex" justify="space-between" align="middle" class="mb10">
        <a-col :span="15">
          <ul class="pop-control">
            <li :class="['pop-hoverShow', { clickShow: activeFirstCode == '' }]" @click="handleFisrtToggle('')">
              热点
            </li>
            <li :class="['pop-hoverShow', { clickShow: activeFirstCode == item.code }]"
              v-for="(item, index) in projectFirstTypes" :key="index" @click="handleFisrtToggle(item.code)">
              {{ item ? item.name : '--' }}
            </li>
          </ul>
        </a-col>
        <a-col :span="9" style="display: flex; justify-content: flex-end">
          <a-input-search style="width: 70%; padding: 0; margin: 0 8px; max-width: 400px"
            placeholder="按项目号、名称、项目经理、项目成员模糊查询" v-model="valueSearch" @search="handleToSearch" allowClear />
          <a-button icon="filter" @click="openSearchForm">高级筛选</a-button>
        </a-col>
      </a-row>
      <div :class="['hte-nav-box', { 'hte-nav-hidden': showMore }]">
        <div class="cascade">
          <div class="floatNav">
            <div class="budget-detail" v-show="['40','41'].includes(activeCode)" @click="projectFileJoinSignLink">
              <span class="iconfont icon-hetong1"></span>
              <p>技术会审</p>
            </div>
            <div class="tab-Build tab-project" v-has="'projectBuild:add'" @click="projectBuild">              
              <span class="iconfont icon-lixiang2"></span>
              <p>我要立项</p>
            </div>
            <div class="tab-Hatch" v-has="'hatchProject:list'" @click="projectHatch">
              <span class="iconfont icon-zhiwu"></span>
              <p>{{ hatchProjectApply }}</p>
            </div>
            <div class="tab-Report" >
              <a-dropdown>
                <a class="ant-dropdown-link" @click="jumpOpen('1')">
                  <div style="display: flex;flex-direction: column;justify-content: space-around;">
                  <span class="iconfont icon-hetong1" style="text-align: center;"></span>
                  <span>合同报工</span>
                </div>
                </a>
                <template #overlay>
                  <a-menu>
                    <a-menu-item @click="jumpOpen('1')">
                      <a href="javascript:;">报工项目</a>
                    </a-menu-item>
                    <a-menu-item @click="jumpOpen('2')">
                      <a href="javascript:;">我的报工单</a>
                    </a-menu-item>
                    <a-menu-item @click="jumpOpen('3')">
                      <a href="javascript:;">验收付款表</a>
                    </a-menu-item>
                    <a-menu-item @click="jumpOpen('4')">
                      <a href="javascript:;">质量通知单</a>
                    </a-menu-item>
                    <a-menu-item @click="jumpOpen('5')">
                      <a href="javascript:;">基建管理单据</a>
                    </a-menu-item>
                  </a-menu>
                </template>
              </a-dropdown>
            </div>
            <div class="tab-Build" v-has="'reportCentent:index'" @click="jumpOpen(6)">
              <span class="iconfont icon-baobiao2"></span>
              <p>海澜工程</p>
            </div>
            
            <!--<div class="invitation-detail" v-has="'myLaunchInvite:list'" @click="projectInvite">
              <img src="@/assets/invitation.png" alt="">
              <a-badge :count="invitedByMe.total" :offset=[-5,-15]>
                <p>我的邀约</p>
              </a-badge>
            </div>
            <div class="commissioned-detail" v-has="'myProjectInvite:list'" @click="applyInvitation">
              <img src="@/assets/commissioned.png" alt="">
              <a-badge :count="invitedByOther.total" :offset=[-5,-15]>
                <p>我的应约</p>
              </a-badge>
            </div>-->
            <div class="tab-Build" v-has="'projectTcSummary:list'" @click="tcGroupBy">
              <span class="iconfont icon-xiangmu4"></span>
              <p>科技质量关联表</p>
            </div>
            <div class="tab-Build"  v-has="'materials_consum'" @click="toMaterialsConsum">
              <span class="iconfont icon-wuliaotoufang"></span>
              <p>物料领用</p>
            </div>
            <div class="tab-Build" v-has="'materials_search'" @click="toMaterialsSearch">
              <span class="iconfont icon-xiangmu3"></span>
              <p>物料查询</p>
            </div>
            <div class="tab-Report">
              <a-dropdown>
                <a class="ant-dropdown-link" @click="jumpOpen('1')">
                  <div style="display: flex;flex-direction: column;justify-content: space-around;">
                  <span class="iconfont icon-hetong1" style="text-align: center;"></span>
                  <span>项目管理</span>
                </div>
                </a>
                <template #overlay>
                  <a-menu>
                    <a-menu-item @click="jumpOpen('11')">
                      <a href="javascript:;">项目验收</a>
                    </a-menu-item>
                    <a-menu-item @click="jumpOpen('12')">
                      <a href="javascript:;">工程变更</a>
                    </a-menu-item>
                    <a-menu-item @click="jumpOpen('13')">
                      <a href="javascript:;">采购申请</a>
                    </a-menu-item>
                    <a-menu-item @click="jumpOpen('14')">
                      <a href="javascript:;">工程奖励</a>
                    </a-menu-item>
                  </a-menu>
                </template>
              </a-dropdown>
            </div>
            <div class="tab-Build" v-has="'reportCentent:index'" @click="gotoCenter">
              <span class="iconfont icon-baobiao2"></span>
              <p>报表中心</p>
            </div>
            <div class="budget-detail" v-has="'projectBuild:budget'" @click="projectBudgetLink">
              <span class="iconfont icon-hetong1"></span>
              <a-badge :count="projectBudget.total" :offset="[-5, -15]">
                <p>项目预算</p>
              </a-badge>
            </div>
          </div>
          <div class="projec-class-box clearFix" style="border-bottom: 1px solid #f2f2f2"
            :class="{ 'project-class-more': more.moreRef0Class }" ref="moreRef0">
            <div class="projec-class-lable">项目分类：</div>
            <ul class="projec-class-list clearFix" :class="{ 'projec-class-list-more': more.moreRef0 }">
              <li :class="['hoverShow', { clickShow: activeCode == item.code }]" @click="handleToggle(item)"
                v-for="(item, index) in projectTypes" :key="index">
                 <a-tooltip overlayClassName="new-tooltip" v-show="['63', '81', '82', '83'].includes(item.code)">
                    <template slot="title">
                      <span v-show="item.code == '63'">仅申购单一的成型的非生产设备如空调、打饭机等选择该类型，申购生产类设备或需要进场施工维修及装修等需选择工程管理类</span>
                      <span v-show="item.code == '81'">生产过程通过流程管理或者工艺优化实现节能减排的项目，项目开展涉及设备改造通过通过工程技改项目立项实施</span>
                      <span v-show="item.code == '82'">生产过程通过流程管理或设备技改优化等实现效率提升的项目，项目开展涉及设备改造通过通过工程技改项目立项实施</span>
                      <span v-show="item.code == '83'">生产过程通过流程管理或技改实现节员或减少用人，提高劳动生产率项目，项目开展设计新增或改造设备投入通过工程技改项目立项实施</span>
                    </template>
                    {{ item ? item.name : '--' }}
                </a-tooltip>
                <span v-show="!['63', '81', '82', '83'].includes(item.code)"> {{ item ? item.name : '--' }}</span>
              </li>
            </ul>
            <div class="btn-more" @click="changeMore('moreRef0')">
              更多
              <a-icon :class="['icon-child-down', { 'icon-child-up': more.moreRef0 }]" slot="suffixIcon"
                type="caret-up" />
            </div>
          </div>
          <div v-if="showSubType" class="projec-class-box clearFix" style="border-bottom: 1px solid #f2f2f2"
            :class="{ 'project-class-more': more.moreRef1Class }" ref="moreRef1">
            <div class="projec-class-lable">项目子类：</div>
            <ul class="projec-class-list clearFix" :class="{ 'projec-class-list-more': more.moreRef1 }">
              <li :class="['hoverShow', { clickShow: projectStatus == '' }]" @click="handleSelectProjectType('')">
                全部
              </li>
              <li :class="['hoverShow', { clickShow: projectStatus == item.code }]"
                @click="handleSelectProjectType(item)" v-for="(item, index) in projectSubType" :key="index">
                {{ item ? item.name : '--' }}
              </li>
            </ul>
            <div class="btn-more" @click="changeMore('moreRef1')">
              更多
              <a-icon :class="['icon-child-down', { 'icon-child-up': more.moreRef1 }]" slot="suffixIcon"
                type="caret-up" />
            </div>
          </div>
          <a-tooltip>
            <template slot="title">
              查询全部时过滤[已结题，创建中，已转储，已终止]。如需查询这4种状态，点击对应状态或搜索查询即可
            </template>
            <div class="projec-class-box clearFix" style="border-bottom: 1px solid #f2f2f2"
              :class="{ 'project-class-more': more.moreRef2Class }" ref="moreRef2">
              <div class="projec-class-lable">项目进度：</div>
              <ul class="projec-class-list clearFix" :class="{ 'projec-class-list-more': more.moreRef2 }">
                <li :class="['hoverShow', { clickShow: scheduleStatus == v.status }]"
                  @click="handleSelectProjectType(v)" v-for="(v, i) in scheduleTypes" :key="i">
                  {{ v.title }}({{ scheduleTypesNum[i] || 0 }})
                </li>
              </ul>
              <div class="btn-more" @click="changeMore('moreRef2')">
                更多
                <a-icon :class="['icon-child-down', { 'icon-child-up': more.moreRef2 }]" slot="suffixIcon"
                  type="caret-up" />
              </div>
            </div>
          </a-tooltip>
          <div class="projec-class-box clearFix">
            <div class="projec-class-lable">项目归属：</div>
            <ul class="projec-class-list clearFix">
              <li :class="['hoverShow', { clickShow: belongToStatus == v.status }]"
                @click="handleSelectbelongToStatus(v)" v-for="(v, i) in belongToStatusTypes" :key="i">
                <a-tooltip overlayClassName="new-tooltip" v-show="i != 0">
                  <template slot="title">
                    <span v-show="i == 1">最新立项：两周内最新审批通过的项目</span>
                    <span v-show="i == 2">我的项目：我是项目经理或者副经理的项目</span>
                    <span v-show="i == 3">我参与的：我是项目成员或者任务单报工员或者协助部门主管或者预算员</span>
                    <span v-show="i == 4">我管理的：我审批过的项目或者我是分类管理员或者我是项目团队参与人的上司包括部门负责人，班子A，分管领导角色</span>
                    <span v-show="i == 5">数字贷项目：工程、二化项目属于数字贷的项目</span>
                    <span v-show="i == 6">超期项目</span>
                    <span v-show="i == 7">能耗环保等级为二级，三级的项目</span>
                  </template>
                  {{ v.title }}({{ belongNum[i] || 0 }})
                </a-tooltip>
                <span v-show="i == 0"> {{ v.title }}({{ belongNum[i] || 0 }})</span>
              </li>
            </ul>
          </div>
        </div>
      </div>
      <div class="hte-nav-tap" :class="{ 'border-nav-top': showMore }">
        <span @click="showMore = !showMore">全部{{ !showMore ? '收起' : '展开' }}
          <a-icon :class="['icon-child-down', { 'icon-child-up': showMore }]" slot="suffixIcon" type="caret-up" />
        </span>
      </div>
      <div class="project-info">
        <div class="info-title">
          <ul class="left-side">
            <li>
              <span>项目总数:</span>
              <span class="fontblue baseSize">{{ projectList.total || '--' }}</span>
            </li>
            <li>
              <span>1级:</span>
              <span class="fontblue baseSize">{{ levelList.s1 || '--' }}</span>
            </li>
            <li>
              <span>2级:</span>
              <span class="fontblue baseSize">{{ levelList.s2 || '--' }}</span>
            </li>
            <li>
              <span>3级:</span>
              <span class="fontblue baseSize">{{ levelList.s3 || '--' }}</span>
            </li>
            <li>
              <span>4级:</span>
              <span class="fontblue baseSize">{{ levelList.s4 || '--' }}</span>
            </li>
            <li>
              <span>X级:</span>
              <span class="fontblue baseSize">{{ levelList.sx || '--' }}</span>
            </li>
            <li>
              <span>待定:</span>
              <span class="fontblue baseSize">{{ levelList.wait || '--' }}</span>
            </li>
            <li>
              <span>排序:</span>
              <span :class="levelOrder == 'Asc' ? 'fontred' : 'fontgreen'" class="btn-sort"
                @click="handleSort('realLevel')">
                等级<i class="iconfont icon-sort_icon"></i></span>
            </li>
            <li>
              <span :class="startTimeOrder == 'Asc' ? 'fontgreen' : 'fontred'" class="btn-sort"
                @click="handleSort('startTime')">
                日期<i class="iconfont icon-sort_icon"></i></span>
            </li>
          </ul>
          <div class="right-side">
            <div :class="{ active: typeFlag === 'list' }" @click="typeFlag = 'list'">
              <a-icon type="bars" />横向
            </div>
            <div :class="{ active: typeFlag === 'card' }" @click="typeFlag = 'card'">
              <a-icon type="appstore" />竖列
            </div>
          </div>
        </div>                
        <div class="flex">
          <div class="tree">
            <!-- 目录树 -->
            <haday-organization-tree
              v-if="treeData.length"
              :props="{ children: 'children', label: 'title', disabled: 'disabled'}"
              :loading="treeLoading"
              :data="treeData" 
              :expandOnClickNode="true"
              treeTitle="组织架构"                
              node-key="key" 
              :currentNodeKey="treeSelectedKeys"
              @node-click="onSelectClass">
            </haday-organization-tree>
          </div>
          <ul :class="[`project-${typeFlag}`]">
            <template v-for="(item, index) in projectList.records">
              <a-divider :key="`divider-${index}`" :dashed="true" v-if="!scheduleStatus && index == lineTemplate">
                以下是创建中、已终止和已转储的项目</a-divider>
              <li :key="index" class="li" @contextmenu.prevent="showMenu(item, $event, index)">
                <template v-if="typeFlag == 'list'">
                  <h3>
                    <span :class="{ 'hte-text-downline': item['projectAll'] === 1 || item['projectMember'] === 1 }"
                      @click="
                        projectDetail(item.id, item.status, item.projectType, item.projectAll, item.projectMember)
                      ">
                      <span v-show="item.importFlag == '1'" class="hot-flag" title="热点项目"></span>
                      {{ item.projectNo }} {{ item.projectName }}
                      <span v-show="item.projectLevel && item.realLevel != '待定'">({{ item.realLevel }})</span>
                      <span v-show="item.overdueProject == '1'" style="color: red; font-weight: 400; font-size: 15px">
                        [超期]</span>                      
                      <a-tooltip overlayClassName="new-tooltip" v-show="item.energyConsumptionLevel == 3">
                        <template slot="title"> 能耗环保等级3级 </template>
                        <!-- <span :class="[`color-code${'3'}`]"> 红码</span> -->
                        <a-tag color="red">
                          红码
                        </a-tag>
                      </a-tooltip>
                      <a-tooltip overlayClassName="new-tooltip" v-show="item.energyConsumptionLevel == 2">
                        <template slot="title"> 能耗环保等级2级 </template>
                        <!-- <span :class="[`color-code${'2'}`]"> 黄码</span> -->
                        <a-tag color="yellow">
                          黄码
                        </a-tag>
                      </a-tooltip>
                      <a-tooltip overlayClassName="new-tooltip" v-show="!!item.resultsTradingFlag">
                        <template slot="title"></template>
                        <!-- <span :class="[`color-code${'4'}`]"> 交易</span> -->
                        <a-tag color="orange">
                          交易
                        </a-tag>
                      </a-tooltip>
                    </span>
                  </h3>
                  <div>
                  <div class="synopsis">                    
                    <p>
                      项目经理：{{ item.projectManager || '--' }}&nbsp;&nbsp;&nbsp;&nbsp;申请人:
                      {{ item.createUserName || '--' }}&nbsp;&nbsp;&nbsp;&nbsp;申请时间: {{ item.startTime || '--' }}
                    </p>
                    <ul class="btn-group">
                      <li @click="projectReportDetail(item.id, item.projectLevel)" v-if="
                        item.status > 3 && item.status != 7 && (item['projectAll'] === 1 || item['projectReport'] === 1)
                      ">
                        <span class="iconfont icon-reportReserve fontbase"></span>报工
                      </li>
                      <li @click="
                        projectDetail(item.id, item.status, item.projectType, item.projectAll, item.projectMember)
                      " v-if="item['projectAll'] === 1 || item['projectMember'] === 1">
                        <span class="iconfont icon-dingdan fontbase"></span>明细
                      </li>
                      <li @click="projectBudgetDetail(item.id)" v-if="
                        item.status > 3 &&
                        item.status != 7 &&
                        (item['projectBudget'] === 1 || (item['projectAll'] === 1 && item['isBudget'] === 1))
                      ">
                        <span class="iconfont icon-yusuan1 fontbase"></span>预算
                      </li>
                      <li @click="projectAuditDetail(item.id)"
                        v-if="item['projectAll'] === 1 || item['projectMember'] === 1">
                        <span class="iconfont icon-shangchengicon_jiaoyichenggong fontbase"></span>状态
                      </li>
                      <li @click="projectTaskDetail(item.projectNo)"
                        v-if="item['status'] > 1 && item['projectTask'] === 1">
                        <span class="iconfont icon-shangchengicon_jiaoyichenggong fontbase"></span>任务
                      </li>
                      <li @click="projectChangeDetail(item)" v-if="
                        (item['status'] === 4 ||
                          item['status'] === 5 ||
                          item['status'] === 6 ||
                          item['status'] === 7 ||
                          item['status'] === 9 ||
                          item['status'] === 10) &&
                        (item['projectAll'] === 1 || item['projectAdmin'] === 1 || item['projectMember'] === 1)
                      ">
                        <span class="iconfont icon-biangeng fontbase"></span>变更
                      </li>
                      <li @click="projectReserveDetail(item)"
                        v-if="item['status'] === 10 && (item['projectAll'] === 1 || item['projectAdmin'] === 1)">
                        <span class="iconfont icon-biangeng fontbase"></span>转储
                      </li>
                      <li @click="toContractList(item.projectNo, item.projectClass)" v-if="item.contractId">
                        <span class="iconfont icon-hetong fontbase"></span>合同
                      </li>
                      <li @click="openHteFilePopList(item)" v-if="item.projectClass=='10' && ['TA','TB','TC','TD'].indexOf(item.projectSubType)>-1">
                        <span class="iconfont icon-jiangjin fontbase"></span>文献
                      </li>
                      <li @click="openHteDoneTipList(item)" v-if="projectDoneShow(item)">
                        <span class="iconfont icon-wanchengxiangmu fontbase"></span>归档
                      </li>
                      <li @click="toOneCilckRemind(item.id)"
                        v-if="item['projectAll'] === 1 && (item.status == '4' || item.status == '5')"
                        title="点击可发送消息提醒逾期未报工的节点报工人">
                        <span class="iconfont icon-hetong fontbase"></span>提醒
                      </li>
                      <li @click="openTtaskListByApproval(item)" v-if="item.projectClass == '30'">
                        <span class="iconfont icon-lishi fontbase"></span>迭代
                      </li>
                      <li @click="showRewardApplyWin(item)" v-if="item['projectAll'] === 1 && !!item['rewardTimeNode']&&(item.projectClass=='30'&&item.realLevel.indexOf('X')<0||item.projectClass!='30')">
                        <span class="iconfont icon-jiangjin fontbase"></span>{{'奖励申请'+(item.rewardApplyCount>0?('('+item.rewardApplyCount+')'):'')}}
                      </li>
                      <!-- <li @click="toProjectClose(item)" v-if="item.projectClass == '40' || item.projectClass == '41'">
                        <span class="iconfont icon-jiangjin fontbase"></span>关闭
                      </li> -->

                      <li @click="projectTechEngineeList(item)" v-if="item.projectClass == '40' || item.projectClass == '41'">
                        <span class="iconfont icon-jiangjin fontbase"></span>技术
                      </li>

                      <li @click="fileJoinSignHistory(item)" v-if="['40','41'].includes(item.projectClass)">
                        <span class="iconfont icon-jiangjin fontbase"></span>会审
                      </li>
                    </ul>
                  </div>
                  <div class="process">
                    <ul>
                      <li v-for="(items, indexs) in item.realTimeLineList" :key="indexs"
                        title="温馨提示：实心代表已完成，空心代表未完成，延误或者超前的已自动计算时间，请把握好项目进度哦！">
                        <span v-if="item.status != 10 && item.status != 7" :class="
                          items.finishReport
                            ? items.nodeStatus == 0
                              ? 'fontgreen'
                              : items.nodeStatus == -1
                                ? 'fontred'
                                : items.nodeStatus == 1
                                  ? 'fontpurple'
                                  : 'fontgrey'
                            : items.nodeStatus == -1
                              ? 'fontred'
                              : items.nodeStatus == 1
                                ? 'fontpurple'
                                : 'fontgrey'
                        ">
                          {{
                              items.nodeStatus == -1 && items.delayDays
                                ? '延误' + Math.abs(items.delayDays) + '天'
                                : items.nodeStatus == 1 && items.delayDays
                                  ? '提前' + Math.abs(items.delayDays) + '天'
                                  : ' '
                          }}

                          <!-- {{items.nodeStatus==-1&&items.delayDays?(items.subTimeNodeCompleteRate?'延误'+Math.abs(items.delayDays)+'天('+items.subTimeNodeCompleteRate+')':'延误'+Math.abs(items.delayDays)+'天')
                            :items.nodeStatus==1&&items.delayDays?'提前'+Math.abs(items.delayDays)+'天':' '}} -->
                          <br />
                          <span>{{ items.subTimeNodeCompleteRate ? '子节点完成率:' + items.subTimeNodeCompleteRate : ' '}}</span>
                        </span>
                        <span class="fontgrey" v-else></span>
                        <div :class="[
                          'content-box',
                          (items.finishReport && items.nodeStatus >= 0) ||
                            (items.finishReport && items.nodeStatus == -1)
                            ? 'greencircle'
                            : items.nodeStatus == -1
                              ? 'redblankcir'
                              : 'greycircle',
                        ]" v-if="item.status != 10 && item.status != 7">
                          <span class="circle"></span>
                        </div>
                        <div :class="['content-box', items.finishReport ? 'greencircle' : 'greycircle']" v-else>
                          <span class="circle"></span>
                        </div>
                        <div class="infobox">
                          <span>{{ items.timeNode }}</span>
                          <p>
                            {{
                                items.completionDateAudit
                                  ? items.completionDateAudit
                                  : items.completionDate
                                    ? items.completionDate
                                    : '--'
                            }}
                          </p>
                        </div>
                      </li>
                    </ul>
                  </div>
                  <div v-if="item.realTimeLineList && item.realTimeLineList.length > 0" class="btn-more"
                    @click="seeTimeMore(item)">甘特图<a-icon class="icon-child-down" slot="suffixIcon" type="caret-down" />
                  </div>
                  <div :class="['status-box', `projectStatusColor${item.status}`]">
                    <span>{{ getCodeNames(item.status,'项目立项状态') }}</span>
                  </div>
                  </div>
                </template>
                <template v-else>
                  <div class="synopsis">
                    <h3 :title="`${item.projectNo} ${item.projectName}`">
                      <span :class="{ 'hte-text-downline': item['projectAll'] === 1 || item['projectMember'] === 1 }"
                        @click="
                          projectDetail(item.id, item.status, item.projectType, item.projectAll, item.projectMember)
                        ">
                        <span v-show="item.importFlag == '1'" class="hot-flag" title="热点项目"></span>
                        {{ item.projectNo }} {{ item.projectName }}
                      </span>
                    </h3>
                    <p>
                      项目经理：{{ item.projectManager || '--' }}&nbsp;&nbsp;&nbsp;&nbsp;申请人:{{ item.createUserName || '--' }}&nbsp;&nbsp;&nbsp;&nbsp;申请时间: {{ item.startTime || '--' }}
                    </p>
                    <p class="level">
                      项目等级：<span>{{ item.projectLevel && item.realLevel != '待定' ? item.realLevel : '--' }}</span>
                      <span style="color: red" v-show="item.overdueProject == '1'">&nbsp;&nbsp;&nbsp;&nbsp;[超期]</span>                      
                      <a-tooltip overlayClassName="new-tooltip" v-show="item.energyConsumptionLevel == 3">
                        <template slot="title"> 能耗环保等级3级 </template>
                        <!-- <span :class="[`color-code${'3'}`]"> 红码</span> -->
                        <a-tag color="red">
                          红码
                        </a-tag>
                      </a-tooltip>
                      <a-tooltip overlayClassName="new-tooltip" v-show="item.energyConsumptionLevel == 2">
                        <template slot="title"> 能耗环保等级2级 </template>
                        <!-- <span :class="[`color-code${'2'}`]"> 黄码</span> -->
                        <a-tag color="yellow">
                          黄码
                        </a-tag>
                      </a-tooltip>
                       <a-tooltip overlayClassName="new-tooltip" v-show="!!item.resultsTradingFlag">
                        <template slot="title"></template>
                        <!-- <span :class="[`color-code${'4'}`]"> 交易</span> -->
                        <a-tag color="orange">
                          交易
                        </a-tag>
                      </a-tooltip>
                    </p>
                  </div>
                  <div class="process">
                    <ul>
                      <template v-for="(items, indexs) in item.realTimeLineList">
                        <li :key="indexs" v-if="indexs < 5" title="温馨提示：实心代表已完成，空心代表未完成，延误或者超前的已自动计算时间，请把握好项目进度哦！" :class="{
                          'li-less2': item.realTimeLineList.length == 2,
                          'li-less1': item.realTimeLineList.length == 1,
                        }">
                          <span :class="[
                            'content-box',
                            (items.finishReport && items.nodeStatus >= 0) ||
                              (items.finishReport && items.nodeStatus == -1)
                              ? 'greencircle'
                              : items.nodeStatus == -1
                                ? 'redblankcir'
                                : 'greycircle',
                          ]" v-if="item.status != 10 && item.status != 7">
                            <span class="circle"></span>
                          </span>
                          <span :class="['content-box', items.finishReport ? 'greencircle' : 'greycircle']" v-else>
                            <span class="circle"></span>
                          </span>
                          <span class="node">{{ items.timeNode }}</span>
                          <span class="infobox">{{
                              items.completionDateAudit
                                ? items.completionDateAudit
                                : items.completionDate
                                  ? items.completionDate
                                  : '--'
                          }}</span>
                          <span v-if="item.status != 10 && item.status != 7" :class="
                            items.finishReport
                              ? items.nodeStatus == 0
                                ? 'fontgreen'
                                : items.nodeStatus == -1
                                  ? 'fontred'
                                  : items.nodeStatus == 1
                                    ? 'fontpurple'
                                    : 'fontgrey'
                              : items.nodeStatus == -1
                                ? 'fontred'
                                : items.nodeStatus == 1
                                  ? 'fontpurple'
                                  : 'fontgrey'
                          ">
                            {{
                                items.nodeStatus == -1 && items.delayDays
                                  ? items.subTimeNodeCompleteRate
                                    ? '延误' + Math.abs(items.delayDays) + '天(' + items.subTimeNodeCompleteRate + ')'
                                    : '延误' + Math.abs(items.delayDays) + '天'
                                  : items.nodeStatus == 1 && items.delayDays
                                    ? '提前' + Math.abs(items.delayDays) + '天'
                                    : ' '
                            }}
                          </span>
                        </li>
                      </template>
                      <li v-if="item.realTimeLineList && item.realTimeLineList.length > 0">
                        <div class="btn-more" @click="seeTimeMore(item)">甘特图</div>
                      </li>
                    </ul>
                  </div>
                  <ul class="btn-group">
                    <li @click="projectReportDetail(item.id, item.projectLevel)" v-if="
                      item.status > 3 && item.status != 7 && (item['projectAll'] === 1 || item['projectReport'] === 1)
                    ">
                      <span class="iconfont icon-reportReserve fontbase"></span>报工
                    </li>
                    <li
                      @click="projectDetail(item.id, item.status, item.projectType, item.projectAll, item.projectMember)"
                      v-if="item['projectAll'] === 1 || item['projectMember'] === 1">
                      <span class="iconfont icon-dingdan fontbase"></span>明细
                    </li>
                    <li @click="projectBudgetDetail(item.id)" v-if="
                      item.status > 3 && item.status != 7 && (item['projectBudget'] === 1 || item['isBudget'] === 1)
                    ">
                      <span class="iconfont icon-yusuan1 fontbase"></span>预算
                    </li>
                    <li @click="projectAuditDetail(item.id)"
                      v-if="item['projectAll'] === 1 || item['projectMember'] === 1">
                      <span class="iconfont icon-shangchengicon_jiaoyichenggong fontbase"></span>状态
                    </li>
                    <li @click="projectTaskDetail(item.projectNo)" v-if="item['status'] > 1 && item['projectTask'] === 1">
                      <span class="iconfont icon-shangchengicon_jiaoyichenggong fontbase"></span>任务
                    </li>
                    <li @click="projectChangeDetail(item)" v-if="
                        (item['status'] === 4 ||
                          item['status'] === 5 ||
                          item['status'] === 6 ||
                          item['status'] === 7 ||
                          item['status'] === 9 ||
                          item['status'] === 10) &&
                        (item['projectAll'] === 1 || item['projectAdmin'] === 1 || item['projectMember'] === 1)
                      ">
                      <span class="iconfont icon-biangeng fontbase"></span>变更
                    </li>
                    <li @click="toContractList(item.projectNo, item.projectClass)" v-if="item.contractId">
                      <span class="iconfont icon-hetong fontbase"></span>合同
                    </li>
                    <li @click="openHteFilePopList(item)" v-if="item.projectClass=='10' && ['TA','TB','TC','TD'].indexOf(item.projectSubType)>-1">
                        <span class="iconfont icon-jiangjin fontbase"></span>文献
                      </li>
                    <li @click="openHteDoneTipList(item)"  v-if="projectDoneShow(item)">
                      <span class="iconfont icon-wanchengxiangmu fontbase"></span>归档
                    </li>
                    <li @click="toOneCilckRemind(item.id)"
                      v-if="item['projectAll'] === 1 && (item.status == '4' || item.status == '5')"
                      title="点击可发送消息提醒逾期未报工的节点报工人">
                      <span class="iconfont icon-hetong fontbase"></span>提醒
                    </li>
                    <li @click="openTtaskListByApproval(item)" v-if="item.projectClass == '30'">
                      <span class="iconfont icon-lishi fontbase"></span>迭代
                    </li>
                    <li @click="showRewardApplyWin(item)" v-if="item['projectAll'] === 1 && !!item['rewardTimeNode']&&(item.projectClass=='30'&&item.realLevel.indexOf('X')<0||item.projectClass!='30')">
                      <span class="iconfont icon-jiangjin fontbase"></span>{{'奖励申请'+(item.rewardApplyCount>0?('('+item.rewardApplyCount+')'):'')}}
                    </li>

                     <li @click="fileJoinSignHistory(item)" v-if="['40','41'].includes(item.projectClass)">
                        <span class="iconfont icon-jiangjin fontbase"></span>会审
                     </li>
                  </ul>

                  <div :class="['status-box', `projectStatusColor${item.status}`]">
                    <span>{{ getCodeNames(item.status,'项目立项状态') }}</span>
                  </div>
                </template>
              </li>
            </template>
            <div class="skeleton" v-show="loadingFlag">
              <a-skeleton active />
              <a-skeleton active />
              <a-skeleton active />
              <a-skeleton active />
            </div>
            <div class="skeleton" v-show="emptyFlag">
              <a-empty style="margin-top: 50px" />
              <div style="text-align: center; font-size: 15px; color: black">
                温馨提示：如需查询[<span style="font-weight: bold; color: red">已结题，创建中，已转储，已终止</span>]的项目，点击对应状态或搜索对应项目号查询即可
              </div>
            </div>            
          </ul>
        </div>  
        <div class="loaddingbox" v-show="loaddingFlag">
          <a-spin spinning :delay="10" tip="加载中" />
        </div>
        <div class="tips-box" v-show="!loaddingFlag && !emptyFlag" @click="handleInfiniteOnLoad"
          :class="{ 'tips-box-more': (projectList.records && projectList.records.length) < projectList.total }">
          {{
              (projectList.records && projectList.records.length) >= projectList.total
                ? '暂无更多数据'
                : '点击加载更多数据'
          }}
        </div>
      </div>
    </div>
    <a-back-top style="right: 50px" />
    <a-modal v-model="visible" title="立项前请选择项目分类" @ok="handleOk">
      <a-row v-if="showFirstPopClass">
        <a-col :span="6" style="margin-top: 6px">项目一级分类:</a-col>
        <a-col :span="12">
          <a-select style="width: 240px" v-model="selectedFirstClass" @change="handleFirstClassChange"
            placeholder="请选择项目一级分类">
            <a-select-option v-for="(item, index) in projectFirstTypes" :key="index" :value="item.code">{{
                item ? item.name : '--'
            }}</a-select-option>
          </a-select>
        </a-col>
      </a-row>
      <a-row v-if="showPopClass">
        <a-col :span="6" style="margin-top: 6px">项目二级分类:</a-col>
        <a-col :span="12">
          <a-select style="width: 240px" v-model="selectedClass" @change="handleClassChange" placeholder="请选择项目二级分类">
            <a-select-option v-for="(item, index) in projectTypes" :key="index" :value="item.code">{{
                item ? item.name : '--'
            }}</a-select-option>
          </a-select>
        </a-col>
      </a-row>
      <a-row v-if="showPopType">
        <a-col :span="6" style="margin-top: 6px">项目三级分类:</a-col>
        <a-col :span="12">
          <a-select style="width: 240px" v-model="selectedType" @change="handleTypeChange" placeholder="请选择项目三级分类">
            <a-select-option v-for="(item, index) in projectSubType" :key="index" :value="item.code">{{
                item ? item.name : '--'
            }}</a-select-option>
          </a-select>
        </a-col>
      </a-row>
    </a-modal>
    <a-modal v-model="visibleFh" title="请选择项目分类" @ok="handleOkFh">
      <a-row v-show="showPopFirstClassFh">
        <a-col :span="6" style="margin-top: 6px">项目一级分类:</a-col>
        <a-col :span="12">
          <a-select style="width: 240px" v-model="selectedFirstClassFh" @change="handleFirstClassChangeFh"
            placeholder="请选择项目一级分类">
            <a-select-option v-for="(item, index) in projectFirstTypes" :key="index" :value="item.code">{{
                item ? item.name : '--'
            }}</a-select-option>
          </a-select>
        </a-col>
      </a-row>
      <a-row v-show="showPopClassFh">
        <a-col :span="6" style="margin-top: 6px">项目二级分类:</a-col>
        <a-col :span="12">
          <a-select style="width: 240px" v-model="selectedClassFh" @change="handleClassChangeFh"
            placeholder="请选择项目二级分类">
            <a-select-option v-for="(item, index) in projectTypes" :key="index" :value="item.code">{{
                item ? item.name : '--'
            }}</a-select-option>
          </a-select>
        </a-col>
      </a-row>
      <a-row v-if="showPopTypeFh">
        <a-col :span="6" style="margin-top: 6px">项目三级分类:</a-col>
        <a-col :span="12">
          <a-select style="width: 240px" v-model="selectedTypeFh" @change="handleTypeChange" placeholder="请选择项目三级分类">
            <a-select-option v-for="(item, index) in projectSubType" :key="index" :value="item.code">{{
              item ? item.name : '--'
              }}</a-select-option>
          </a-select>
        </a-col>
      </a-row>
    </a-modal>
    <a-modal title="项目变更历史记录" :visible="projectChange.showHistoryList" @ok="projectChange.showHistoryList = false"
      @cancel="projectChange.showHistoryList = false" width="80vw" height="80vh" :destroyOnClose="true">
      <div style="margin-bottom: 5px">
        <a-button type="primary" @click="addChangeOrder" style="margin-right: 10px"
          v-if="projectChange.projectStatus < 6||projectChange.projectClass=='30'">
          <a-icon type="plus-circle" />新增
        </a-button>
        <a-button @click="projectReserve">
          <a-icon type="select" />转储备
        </a-button>
        <a-button @click="loadChangeRecord">
          <a-icon type="select" />刷新
        </a-button>
      </div>
      <a-table :columns="projectChange.changeHistoryCols" :data-source="projectChange.changeHistoryData"
        :scroll="{ x: true }" bordered :pagination="false" rowKey="id">
        <template slot="projectChangeNo" slot-scope="text, record">
          <a @click="showChangeDetail(record.id, record.createUserId, record.status)">{{ record.projectChangeNo }}</a>
        </template>
      </a-table>
    </a-modal>    
    <a-modal title="技术会审记录" :visible="fileJoinSign.showHistoryList" @ok="fileJoinSign.showHistoryList = false"
      @cancel="fileJoinSign.showHistoryList = false" width="80vw" height="80vh" :destroyOnClose="true">
      <div style="margin-bottom: 5px">
        <a-button type="primary" @click="addFileJoinSign" style="margin-right: 10px">
          <a-icon type="plus-circle" />新增
        </a-button>
        <a-button @click="delFileJoinSign">
          <a-icon type="select" />删除
        </a-button>
      </div>
      <a-table :columns="fileJoinSign.historyCols" :data-source="fileJoinSign.historyData"
        :scroll="{ x: true }" bordered :pagination="false" rowKey="id" :row-selection="rowSelection">
        <template slot="billNo" slot-scope="text, record">
          <a @click="openFileJoinSignAdd(record.billNo)">{{ record.billNo }}</a>
        </template>
        <template slot="status" slot-scope="text">
          {{ text == '1' ? '审批不通过' : (text == '2' ? '审批完成' : (text == '3' ? '创建中' : '审批中'))}}
        </template>
      </a-table>
    </a-modal>
    <a-modal title="全部合同状态信息" :visible="contractData.showContract" @ok="contractData.showContract = false"
      @cancel="contractData.showContract = false" width="80vw" height="80vh" :destroyOnClose="true">
      <a-table :scroll="{ x: true }" :columns="contractData.contractCols" :data-source="contractData.contractList"
        bordered :pagination="false" rowKey="id"></a-table>
    </a-modal>

    <task-list-by-approval-time-node ref="taskListByApprovalTimeNode"></task-list-by-approval-time-node>

    <a-modal :visible="showSearchForm" width="70vw" :bodyStyle="{ padding: '10px' }" title="高级查询"
      @cancel="handleToCancel">
      <template slot="footer">
        <a-button @click="handleToCancel">取消</a-button>
        <a-button @click="clearSearch">清空</a-button>
        <a-button type="primary" @click="handleToSearch">查询</a-button>
      </template>
      <a-form-model ref="ruleForm" :label-col="labelCol" :wrapper-col="wrapperCol">
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item label="项目编号">
              <a-input v-model="searchForm.projectNo" allowClear />
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="项目名称">
              <a-input v-model="searchForm.projectName" allowClear />
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="项目经理">
              <a-input v-model="searchForm.manager" allowClear />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="8">
            <a-form-model-item label="申请人">
              <a-input v-model="searchForm.createUser" allowClear />
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="申请时间">
              <a-range-picker @change="applyDateChange" format="YYYY-MM-DD" v-model="applyDate" />
            </a-form-model-item>
          </a-col>
          <a-col :span="8">
            <a-form-model-item label="是否超期">
              <a-radio-group v-model="searchForm.overdueProject">
                <a-radio :value="1"> 是 </a-radio>
                <a-radio :value="0"> 否 </a-radio>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-modal>
    <award-apply-tip ref="tip"></award-apply-tip>
    <AwardApplyTip40 ref="tip40"></AwardApplyTip40>
    <SubTechEngineeList ref="SubTechEngineeList"/>
    <ChangeRecordHistory ref="ChangeRecordHistory"/>
    <HteFilePopList ref="HteFilePopList"/>
    <DoneTipList ref="DoneTipList"/>
    <ul v-show="showContextmenu" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
      <li @click="showContextmenu = false"><a-icon type="close" style="margin-right:5px;"/>关闭</li>
      <li @click="updateStatus(selectedTag)"><a-icon type="edit" style="margin-right:5px;"/>修改状态</li>
    </ul>
    <a-modal :visible="showUpdateStatus" width="40vw" :bodyStyle="{ padding: '10px' }" title="修改项目状态"
      @cancel="showUpdateStatus = false"
      @ok="updateStatusHandler">
      <a-row>
        <a-col :span="6" style="margin-top: 6px;text-align: right;">需要更改的状态:</a-col>
        <a-col :span="12">
          <a-select style="width: 240px" v-model="changeStatus">
            <a-select-option v-for="(item, index) in codes['项目立项状态']" :key="index" :value="item.code">{{
             item.name
              }}</a-select-option>
          </a-select>
        </a-col>
      </a-row>
      
      </a-modal>
  </div>
</template> 
<script>
import {
  queryWhenLeader,
  queryWhenLeaderAwait,
  queryReportPage,
  myLaunchInviteList,
  myProjectInviteList,
  taskCustomList,
} from '@/api/projectBuild'
import { codeInfoList } from '@/api/codeInfo'
import Vue from 'vue'
import { getAction, postAction } from '@/api/manage'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { ResizeHandleMoreMixin } from '@/mixins/ResizeHandleMoreMixin'
import {Checkbox, CheckboxGroup, Tree, Input} from 'element-ui'; 
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
Vue.use(Tree);
Vue.use(Input);
import { triggerWindowResizeEvent } from '@/utils/util'
import {filterHasPermission} from '@/utils/hasPermission'
import { CodesMixin } from '@/mixins/CodesMixin'
export default {
  components: {
    HomeNav: () => import('@/components/layouts/HomeNav'),
    TaskListByApprovalTimeNode: () => import('@/components/tools/taskListByApprovalTimeNode'),
    AwardApplyTip: () => import('@/views/projectBuild/rewardApply/tip'),
    AwardApplyTip40: () => import('@/views/projectBuild/rewardApply/applyProject/tip'),
    SubTechEngineeList: () => import('@/views/tech/SubTechEngineeList'),
    ChangeRecordHistory: () => import('@/views/projectChange/ChangeRecordHistory'),
    HteFilePopList: () => import('@/views/library/HteFilePopList'),
    DoneTipList: () => import('@/views/projectBuild/projectDone/tipList'),
  },
  mixins: [ResizeHandleMoreMixin,CodesMixin],
  data() {
    return {
      showMore: false,
      userinfo: {
        info: this.$store.getters.userInfo,
        module: 'projectPavilion',
      },
      projectFirstTypes: [],
      projectTypes: [],
      projectSubType: [],
      projectList: {},
      pendingApproval: {},
      projectBudget: {},
      invitedByMe: {},
      invitedByOther: {},
      missionList: {},
      activeCode: '10',
      activeFirstCode: '',
      projectStatus: 0,
      scheduleTypes: [
        // 近期待处理、执行中、待验收、已结题、待上会、创建中、已上线/投产、已延误、已终止
        // 1创建中，3待上会，4执行中，5待验收，6已结题，7已终止，8近期待处理，9已上线/投产，10已延误  ,2待审批
        // 前面的是显示  执行中 4、待验收5、已结题6、待上会3   ;;;;分割线下面 显示 创建中状态是1、已终止 状态是7
        // 创建中的和已终止的项目
        { title: '全部', status: null },
        { title: '近期待处理', status: 8 },
        { title: '执行中', status: 4 },
        { title: '待审批', status: 2 },
        { title: '待上会', status: 3 },
        { title: '待验收', status: 5 },
        { title: '已延误', status: 9 },
        { title: '已结题', status: 6 },
        { title: '创建中', status: 1 },
        { title: '已转储', status: 10 },
        { title: '已终止', status: 7 },
      ],
      belongToStatusTypes: [
        { title: '全部', status: null },
        { title: '最新立项', status: 3, name: 'newPro' },
        { title: '我的项目', status: 1, name: 'minePro' },
        { title: '我参与的', status: 2, name: 'minePro' },
        { title: '我管理的', status: 4, name: 'managePro' },
      ],
      belongToStatusTypesCopy:[
        { title: '全部', status: null },
        { title: '最新立项', status: 3, name: 'newPro'  },
        { title: '我的项目', status: 1, name: 'minePro' },
        { title: '我参与的', status: 2, name: 'partPro' },
        { title: '我管理的', status: 4, name: 'managePro' },
      ],
      digitalLoanStatus:{ title: '数字贷项目', status: 5, name: 'digitalLoan' },
      techBelongStatus:[ 
        { title: '超期项目', status: 6, name: 'delayPro' },
        { title: '超能效标准', status: 7, name: 'superPro' },
      ],
      scheduleTypesNum: [],
      belongNum: [],
      statusSortList: [
        '已转储',
        '已终止',
        '创建中',
        '验收中',
        '已上线/投产',
        '已结题',
        '结题',
        '待验收',
        '已延误',
        '待上会',
        '待审批',
        '执行中',
        '近期待处理',
      ], // 倒序排列，‘执行中’显示最前
      lineTemplate: null,
      projectSortAllList: [],
      scheduleStatus: null,
      belongToStatus: null,
      loadingFlag: false,
      emptyFlag: false,
      levelOrder: 'Asc',
      startTimeOrder: 'Asc',
      levelList: {},
      valueSearch: this.$route.query.searchWord,
      loaddingFlag: false,
      pageNO: 1,
      sortFlag: true,
      busy: false,
      visible: false,
      visibleFh: false,
      showFirstPopClass: false,
      showPopClass: false,
      showPopFirstClassFh: false,
      showPopClassFh: false,
      showPopType: false,
      showPopTypeFh: false,
      radioGcType: 1,
      selectedFirstClass: '',
      selectedClass: '',
      selectedFirstClassFh: '',
      selectedClassFh: '',
      selectedType: '',
      selectedTypeFh: '',
      hatchProjectApply: '孵化项目',
      projectChange: {
        projectBuildId: '',
        projectClass: '',
        projectStatus: 0,
        showHistoryList: false,
        budgetChangeContentData: { 1: '项目总预算调整', 2: '项目内预算调整', 3: '费用支出公司变更' },
        changeContentData: {
          0: '基本信息',
          1: '时间表',
          2: '价值表',
          3: '核心力值表',
          4: '预算表',
          5: '团队表',
          6: '附件表',
        },
        statusData: { 1: '创建中', 2: '待审批', 3: '审批通过', 4: '审批不通过' },
        changeHistoryCols: [
          { title: '状态', width: '120px', align: 'center', dataIndex: 'statusName', key: 'statusName' },
          {
            title: '变更单号',
            width: '120px',
            align: 'left',
            dataIndex: 'projectChangeNo',
            key: 'projectChangeNo',
            scopedSlots: { customRender: 'projectChangeNo' },
          },
          { title: '变更内容', align: 'center', dataIndex: 'changeContent', key: 'changeContent' },
          { title: '预算变更内容', align: 'center', dataIndex: 'budgetChangeContent', key: 'budgetChangeContent' },
          { title: '申请人', width: '100px', align: 'center', dataIndex: 'createUserName', key: 'createUserName' },
          { title: '申请日期', width: '120px', align: 'center', dataIndex: 'createTime', key: 'createTime' },
          { title: '提交时间', width: '120px', align: 'center', dataIndex: 'submitTime', key: 'submitTime' },
        ],
        changeHistoryData: [],
      },
      fileJoinSign: {
        projectBuildId: '',
        projectNo: '',
        projectName: '',
        showHistoryList: false,
        historyCols: [
          { title: '状态', width: '120px', align: 'center', dataIndex: 'status', key: 'status',scopedSlots: { customRender: 'status' }},
          {
            title: '会审单号',
            width: '150px',
            align: 'left',
            dataIndex: 'billNo',
            key: 'billNo',
            scopedSlots: { customRender: 'billNo' },
          },
          { title: '会审标题', align: 'center', dataIndex: 'fileTitle', key: 'fileTitle' },
          { title: '文件类型', align: 'center', dataIndex: 'fileTypeName', key: 'fileTypeName' },
          { title: '申请人', width: '100px', align: 'center', dataIndex: 'createUserName', key: 'createUserName' },
          { title: '申请时间', width: '200px', align: 'center', dataIndex: 'createDate', key: 'createDate' }
        ],
        historyData: [],
      },
      sign: '',
      sortOrder: '',
      defaultOrderItems: [
        { column: 'startTime', asc: false },
        { column: 'realLevel', asc: true },
      ],
      currentOrderItems: [],
      spinning: true,
      typeFlag: 'list', // 默认横向
      contractData: {
        queryUrl: '/hte/contract/queryAll',
        showContract: false,
        contractCols: [
          { title: 'WBS号', width: '120px', align: 'left', dataIndex: 'costNumber', key: 'costNumber' },
          { title: '合同编号', width: '150px', align: 'left', dataIndex: 'contractCode', key: 'contractCode' },
          { title: '合同名称', align: 'center', dataIndex: 'contractName', key: 'contractName' },
          { title: '合同起草人/跟进人', width: '150px', align: 'center', dataIndex: 'draftUser', key: 'draftUser' },
          { title: '合同状态', width: '120px', align: 'center', dataIndex: 'contractStatus', key: 'contractStatus' },
          {
            title: '当前审批人/处理人',
            width: '200px',
            align: 'center',
            dataIndex: 'currentHandler',
            key: 'currentHandler',
          },
        ],
        contractList: [],
      },
      subCodeUrl: '/manage/codeInfo/querySubCodeList',
      showSearchForm: false,
      searchForm: {},
      labelCol: { span: 8 },
      wrapperCol: { span: 15 },
      projectAll: false,
      isAdmin: false,
      isMember: false,
      firstInto: false,
      showSubType: false,
      searchProjectClass: [],
      rotationChartList: [],
      rdActiveCode: '',
      urls: {
        changeStatus: '/projectBuild/changeStatus',
      },
      upmsPermissions: [],
      applyDate: null,
      newFlag: this.$route.query.newFlag,
      homePageBigType: this.$route.query.bigType,
      //公司领导角色初始化科技分类
      homePageSubType: this.$route.query.subType,
      // 机构树
      treeLoading: true,
      treeData: [],
      treeSelectedKeys: 0,
      subDeptIdByAtypeRoot: [],
      showContextmenu:false,
      left:0,
      top:0,
      changeStatus:0,
      selectedTag:{},
      showUpdateStatus:false,
      projectStatusData: { "1": '创建中', "2": '待审批', "3": '待上会', "4": '执行中', "5": '验收中', "6": '结题', "7": '立项不成立',"9": '销项', "10": '转储' },
      selectedRows:[],
      selectedRowKeys:[],
      currentRecord:{}
    }
  },
  computed: {
    rowSelection() {
      return {
        onChange: (selectedRowKeys, selectedRows) => {
          this.selectedRows = selectedRows
          this.selectedRowKeys = selectedRowKeys
        },
        getCheckboxProps: (record) => ({
          props: {
            disabled: record.status == '2' || record.status == '4',
          },
        }),
      }
    },
  },
  mounted() {
    let types = []
    types.push('项目立项状态')
    this.fetchCodes(types)
    this.initData()
    this.firstInto = true
    this.getTreeData()    
  },
  methods: {
    carouselOnChange(){
      triggerWindowResizeEvent()
    },
    applyDateChange(date, dateString) {
      this.searchForm.beginDay = dateString[0]
      this.searchForm.endDay = dateString[1]
    },
    initData() {
      let _this = this
      codeInfoList({ column: 'parentid', order: 'Asc', pageNo: 0, pageSize: -1, isdel: false, type: '项目大类' }).then(
        (res) => {
          _this.projectFirstTypes = res.result.records
          this.$nextTick(() => {
            this.setBtnMore('moreRef1')
            this.setBtnMore('moreRef2')
          })          
          let homePageParams = localStorage.getItem('homePageParams')
          if (homePageParams != null) {
            if (this.homePageBigType) {
              // modify by dr 20220831 热点列表进来
              if (this.homePageBigType == '1') {
                this.homePageBigType = ''
              }
              homePageParams = this.homePageBigType
              _this.handleFisrtToggle(homePageParams, res.result,null,this.homePageSubType,this.valueSearch)
             // localStorage.removeItem('homePageParams')
              if(this.homePageBigType=='K'){
                // &&this.belongToStatusTypes.length<6
                // this.belongToStatusTypes.push(this.digitalLoanStatus);
                this.belongToStatusTypes = [...this.belongToStatusTypesCopy,this.digitalLoanStatus]
              }
            } else {
              getAction('/home/getInitProjectType').then((res) => {
                if (res.code == 200 && res.result) {
                  homePageParams = res.result.code
                } else {
                  homePageParams = ''
                }
                _this.handleFisrtToggle(homePageParams, res.result)
                //localStorage.removeItem('homePageParams')
              })
            }
          }
        }
      )

      codeInfoList({ column: 'code', order: 'asc', pageNo: 0, pageSize: -1, isdel: false, type: '项目馆轮播图' }).then(
        (res) => {
          _this.rotationChartList = res.result.records
          this.$refs.carousel.goTo(0)
        }
      )

      //项目预算列表
      queryReportPage({ pageNo: 0, pageSize: -1, status: 4, projectType: 'budget', budgetStatus: 2 }).then((res) => {
        this.projectBudget = res.result
      })
      // //我邀约分页
      // myLaunchInviteList({ pageNo: 0, pageSize: -1 }).then(res => {
      //   this.invitedByMe = res.result
      // })
      // //被邀约分页
      // myProjectInviteList({ pageNo: 0, pageSize: -1 }).then(res => {
      //   this.invitedByOther = res.result
      // })
    },
    handleToggle(item) {
      if (this.loadingFlag) {
        return
      }
      this.projectList = []
      this.projectStatus = ''
      this.scheduleStatus = null
      this.belongToStatus = null
      this.emptyFlag = false
      this.valueSearch = ''
      this.activeCode = item.code
      if(this.activeCode=='40'){
        this.belongToStatusTypes = [...this.belongToStatusTypesCopy,this.digitalLoanStatus]
        // if(this.belongToStatusTypes.length<6){
        //   this.belongToStatusTypes.push(this.digitalLoanStatus);
        // }
      }else if (this.activeCode=='10'){
        this.belongToStatusTypes = [...this.belongToStatusTypesCopy,...this.techBelongStatus]
        // if(this.belongToStatusTypes.length===6){
        //   this.belongToStatusTypes.splice(5,1)
        // }
      } else {
        this.belongToStatusTypes = this.belongToStatusTypesCopy
      }
      if (!!this.activeCode) {
        this.getSelectSubTypeByActiveCode()
      } else {
        this.getSubTypeListByActiveFirstCode()
      }
      if (['10','20','30','40','50','62','80'].includes(this.activeCode) || this.activeFirstCode == 'Z') {
        this.showSubType = true
      } else {
        this.showSubType = false
      }
      this.getCategoryList(this.defaultOrderItems)
      if (item.code === '40' || item.code == '41') {
        this.hatchProjectApply = '动议申请'
      } else {
        this.hatchProjectApply = '孵化项目'
      }
    },
    handleSelectProjectType(item, superItem) {
      if (this.loadingFlag) {
        return
      }
      this.projectList = []
      this.scheduleStatus = null
      this.belongToStatus = null
      this.emptyFlag = false
      this.valueSearch = ''
      if (item == '') {
        this.projectStatus = ''
      } else if (item.code) {
        this.projectStatus = item.code
      }
      if (item.status) {
        this.scheduleStatus = item.status
      }
      this.getCategoryList(this.defaultOrderItems)
    },
    handleFisrtToggle(code, item, type,subType,keyword) {      
      if (this.loadingFlag) {
        return
      }
      if (this.newFlag&&this.newFlag!='false') {
        this.belongToStatus = '3'
      }
      this.projectList = []
      this.projectStatus = ''
      this.scheduleStatus = null
      this.emptyFlag = false
      this.valueSearch = keyword ? keyword :''
      this.activeFirstCode = code
      this.activeCode = subType?subType:'';
      if(this.activeFirstCode=='K'){
        this.belongToStatusTypes = [...this.belongToStatusTypesCopy,this.digitalLoanStatus]
        // if(this.belongToStatusTypes.length<6){
        //   this.belongToStatusTypes.push(this.digitalLoanStatus);
        // }
      }else if (this.activeCode == '10'){
        // if(this.belongToStatusTypes.length===6){
        //   this.belongToStatusTypes.splice(5,1)
        // }
        this.belongToStatusTypes = [...this.belongToStatusTypesCopy,...this.techBelongStatus]
      } else {
        this.belongToStatusTypes = this.belongToStatusTypesCopy
      }
      if (!!this.activeFirstCode) {
        // 有值的时间查询具体的项目分类
        this.getProjectTypeByActiveFirstCode()
        if (this.activeFirstCode == 'Z') {
          // 专业精进下的项目分类有子类就显示子类
          this.showSubType = true
          this.getSubTypeListByActiveFirstCode()
        } else {
          this.showSubType = false
        }
      } else {
        // 空值的时候查询热点项目
        this.showSubType = false
        
        // todo drcary 查这个人的热点项目
        this.getProjectTypeByRdProject()
      }

      //公司领导角色初始化科技分类
      if (!!this.activeCode) {
        this.getSelectSubTypeByActiveCode()
      }
      this.getCategoryList(this.defaultOrderItems)
      this.hatchProjectApply = '孵化项目'
    },
    getProjectTypeByActiveFirstCode() {
      codeInfoList({
        column: 'additional_field',
        order: 'Asc',
        pageNo: 0,
        pageSize: -1,
        isdel: false,
        type: '项目分类',
        parentid: this.activeFirstCode,
      }).then((res) => {
        this.projectTypes = res.result.records
        this.projectTypes.splice(0, 0, { code: '', name: '全部', type: '项目分类', isdel: '0', parentid: '' })
        this.$nextTick(() => {
          this.setBtnMore('moreRef0')
        })
      })
    },
    getSelectSubTypeByActiveCode(code) {
      if (!this.activeCode) {
        return
      }
      codeInfoList({
        column: 'parentid',
        order: 'Asc',
        pageNo: 0,
        pageSize: -1,
        isdel: false,
        type: '项目子类',
        parentid: this.activeCode,
      }).then((res) => {
        this.projectSubType = res.result.records
        this.$nextTick(() => {
          this.setBtnMore('moreRef1')
        })
      })
    },
    // 根据项目大类来查询具体的项目子类
    getSubTypeListByActiveFirstCode() {
      getAction(this.subCodeUrl, { type: '项目子类', parentid: this.activeFirstCode })
        .then((res) => {
          if (res.code == 200) {
            this.projectSubType = res.result
            this.$nextTick(() => {
              this.setBtnMore('moreRef1')
            })
          } else {
            this.$message.warning('项目子类:' + res.message)
          }
        })
        .catch((res) => {
          this.$message.warning('项目子类:' + res.message)
        })
    },
    getProjectTypeByRdProject() {
      postAction('/home/hotTypeList').then((res) => {
          this.projectTypes = res.result || []
          this.projectTypes.splice(0, 0, { code: '', name: '全部', type: '项目分类', isdel: '0', parentid: '' })
          this.$nextTick(() => {
            this.setBtnMore('moreRef0')
          })
        })
        .catch((res) => {
          this.$message.warning('热点项目:' + res.message)
        })
    },
    getProjectTypeByRd() {
      codeInfoList({ column: 'code', order: 'Asc', pageNo: 0, pageSize: -1, isdel: false, type: '热点项目' }).then(
        (res) => {
          this.projectTypes = res.result.records
          this.projectTypes.splice(0, 0, { code: '', name: '全部', type: '项目分类', isdel: '0', parentid: '' })
          this.$nextTick(() => {
            this.setBtnMore('moreRef0')
          })
        }
      )
    },
    handleSelectbelongToStatus(item) {
      if (this.loadingFlag) {
        return
      }
      this.projectList = []
      // this.scheduleStatus=null
      this.emptyFlag = false
      this.valueSearch = ''
      this.belongToStatus = null
      this.newFlag = false
      if (item.status) {
        this.belongToStatus = item.status
      }
      this.getCategoryList(this.defaultOrderItems)
    },
    showSubTypeListByZ() {
      this.showSubType = true
      this.getSubTypeListByActiveFirstCode()
    },
    handleSort(signal) {
      let orderItems = []
      if (signal == 'realLevel') {
        this.sortFlag = true
        if (this.levelOrder == 'Asc') {
          this.levelOrder = 'desc'
          orderItems.push({ column: 'realLevel', asc: false })
        } else {
          this.levelOrder = 'Asc'
          orderItems.push({ column: 'realLevel', asc: true })
        }
      } else if (signal == 'startTime') {
        this.sortFlag = false
        if (this.startTimeOrder == 'Asc') {
          this.startTimeOrder = 'desc'
          orderItems.push({ column: 'startTime', asc: false })
        } else {
          this.startTimeOrder = 'Asc'
          orderItems.push({ column: 'startTime', asc: true })
        }
      }
      this.getCategoryList(orderItems)
    },
    getCategoryList(orderItems) {
      // this.sign = sign
      // this.sortOrder = sortOrder
      this.currentOrderItems = orderItems
      this.pageNO = 1
      this.levelList = { s1: 0, s2: 0, s3: 0, s4: 0, sx: 0, wait: 0 }
      this.loadingFlag = true
      this.emptyFlag = false

      const _this = this
      queryWhenLeader({
        orderItems: orderItems,
        pageNo: '1',
        projectFirstClass: this.activeFirstCode,
        projectClass: this.activeCode,
        projectSubType: this.projectStatus || '',
        pageSize: 10,
        type: this.scheduleStatus,
        keyword: this.valueSearch,
        searchForm: JSON.stringify(this.searchForm),
        belongToStatus: this.belongToStatus,
        treeDeptId: this.treeSelectedKeys,
        subDeptIdByAtypeRoot: this.subDeptIdByAtypeRoot
      }).then((res) => {
        if (res.result && res.result.records.length > 0) {
          this.getStatusSortList(res.result.records)
          this.projectList.total = res.result.total // projectList.total
          this.loadingFlag = false
          this.countLevel(res.result.records)
        } else {
          this.emptyFlag = true
          this.loadingFlag = false
          this.spinning = false

          if (this.newFlag) {
            this.newFlag = false
            this.handleSelectbelongToStatus({ status: null })
          }
        }
        this.getProjectNumber()
      }).catch(()=>{
        this.emptyFlag = true
        this.loadingFlag = false
        this.spinning = false
      })
    },
    getTimeLine(list) {
      postAction('/home/getProjectTimeLine', list).then((res) => {
        if (res.code == 200) {
          const arr = res.result
          if (this.projectList.records) {
            this.projectList.records.forEach((item) => {
              arr.forEach((subItem) => {
                if (item.id == subItem.id) {
                  item.realTimeLineList = subItem.realTimeLineList
                }
              })
            })
          }
          this.projectList.records = this.projectList.records
          this.$forceUpdate()
        }
      })
    },
    getProjectNumber() {
      this.getProjectBelongNumber()
      this.getProjectNumberTwo()
      postAction('/home/queryProjectNumbers', {
        projectFirstClass: this.activeFirstCode,
        projectClass: this.activeCode,
        projectSubType: this.projectStatus || '',
        keyword: this.valueSearch,
        searchForm: JSON.stringify(this.searchForm),
        belongToStatus: this.belongToStatus,
        type: this.scheduleStatus,
        treeDeptId: this.treeSelectedKeys,
        subDeptIdByAtypeRoot: this.subDeptIdByAtypeRoot
      }).then((res) => {
        if (res.code == 200 && res.result) {
          this.$set(this.scheduleTypesNum, 0, this.projectList.total || 0)
          this.$set(this.scheduleTypesNum, 2, res.result.working || 0)
          this.$set(this.scheduleTypesNum, 3, res.result.approving || 0)
          this.$set(this.scheduleTypesNum, 4, res.result.meeting || 0)
          this.$set(this.scheduleTypesNum, 5, res.result.waiting || 0)
          this.$set(this.scheduleTypesNum, 7, res.result.finish || 0)
          this.$set(this.scheduleTypesNum, 8, res.result.creating || 0)
          this.$set(this.scheduleTypesNum, 9, res.result.turning || 0)
          this.$set(this.scheduleTypesNum, 10, res.result.ending || 0)
        } else {
          this.$set(this.scheduleTypesNum, 0, 0)
          this.$set(this.scheduleTypesNum, 2, 0)
          this.$set(this.scheduleTypesNum, 3, 0)
          this.$set(this.scheduleTypesNum, 4, 0)
          this.$set(this.scheduleTypesNum, 5, 0)
          this.$set(this.scheduleTypesNum, 7, 0)
          this.$set(this.scheduleTypesNum, 8, 0)
          this.$set(this.scheduleTypesNum, 9, 0)
          this.$set(this.scheduleTypesNum, 10, 0)
        }
      })
    },
    getProjectNumberTwo() {
      postAction('/home/queryProjectNumbersTwo', {
        projectFirstClass: this.activeFirstCode,
        projectClass: this.activeCode,
        projectSubType: this.projectStatus || '',
        keyword: this.valueSearch,
        searchForm: JSON.stringify(this.searchForm),
        belongToStatus: this.belongToStatus,
        type: this.scheduleStatus,
        treeDeptId: this.treeSelectedKeys,
        subDeptIdByAtypeRoot: this.subDeptIdByAtypeRoot
      }).then((res) => {
        if (res.code == 200 && res.result) {
          this.$set(this.scheduleTypesNum, 1, res.result.waitDeal || 0)
          this.$set(this.scheduleTypesNum, 6, res.result.late || 0)
        } else {
          this.$set(this.scheduleTypesNum, 1, 0)
          this.$set(this.scheduleTypesNum, 6, 0)
        }
      })
    },
    getProjectBelongNumber() {
      postAction('/home/queryProjectBelongNumbers', {
        projectFirstClass: this.activeFirstCode,
        projectClass: this.activeCode,
        projectSubType: this.projectStatus || '',
        keyword: this.valueSearch,
        searchForm: JSON.stringify(this.searchForm),
        belongToStatus: this.belongToStatus,
        type: this.scheduleStatus,
        treeDeptId: this.treeSelectedKeys,
        subDeptIdByAtypeRoot: this.subDeptIdByAtypeRoot,
        belongList: this.belongToStatusTypes.map(item => {
          return item.name
        })
      }).then((res) => {
        if (res.code == 200 && res.result) {
          this.belongNum = [
            this.projectList.total,
            res.result.newPro,
            res.result.minePro,
            res.result.partPro,
            res.result.managePro,
            res.result.digitalLoan || res.result.delayPro || 0,
            res.result.superPro
          ]
        } else {
          this.belongNum = [0, 0, 0, 0, 0, 0, 0]
          this.$message.warning('数据加载失败:' + res.message)
        }
      })
    },
    /**
     * 状态排序 && 增加分割线
     * 排序规则: 按照this.statusSortList数组倒序排列，“执行中”显示最前
     * 分割线规则：
     */
    getStatusSortList(list) {
      list.sort((a, b) => {
        return this.statusSortList.indexOf(b.projectStatus) - this.statusSortList.indexOf(a.projectStatus)
      })
      list.sort((a, b) => {
        if (a.projectSubType == 'TE' || b.projectSubType == 'TE') {
          if (a.projectSubType === b.projectSubType) {
            return 0
          } else {
            return a.projectSubType > b.projectSubType ? 1 : -1
          }
        }
      })
      this.lineTemplate = list.findIndex((item) => {
        return ['创建中', '已终止', '已转储'].includes(item.projectStatus)
      })
      this.projectList.records = list
      let proejctBuildIdList = []
      list.forEach((item) => {
        proejctBuildIdList.push(item.id)
      })
      this.getTimeLine(proejctBuildIdList)
    },
    countLevel(arr) {
      this.spinning = true
      queryWhenLeader({
        orderItems: this.currentOrderItems,
        pageNo: '1',
        projectFirstClass: this.activeFirstCode,
        projectClass: this.activeCode,
        projectSubType: this.projectStatus || '',
        pageSize: -1,
        type: this.scheduleStatus,
        keyword: this.valueSearch,
        hasLevel: '1',
        searchForm: JSON.stringify(this.searchForm),
        belongToStatus: this.belongToStatus,
        treeDeptId: this.treeSelectedKeys,
        subDeptIdByAtypeRoot: this.subDeptIdByAtypeRoot
      }).then((res) => {
        if (res.result && res.result.records.length > 0) {
          let s1 = 0,
            s2 = 0,
            s3 = 0,
            s4 = 0,
            sx = 0,
            wait = 0
          res.result.records.map((item) => {
            if (!!item.realLevel) {
              let level = item.realLevel.charAt(item.realLevel.length - 1)
              switch (level) {
                case '1':
                  s1++
                  break
                case '2':
                  s2++
                  break
                case '3':
                  s3++
                  break
                case '4':
                  s4++
                  break
                case 'X':
                  sx++
                  break
                default:
                  wait++
              }
            } else {
              wait++
            }
          })
          this.levelList = { s1: s1, s2: s2, s3: s3, s4: s4, sx: sx, wait: wait }
          this.spinning = false
        } else {
          this.spinning = false
        }
      })
    },
    handleSearch() {
      this.projectList = []
      //this.scheduleStatus=null
      this.emptyFlag = false
      this.getCategoryList(this.defaultOrderItems)
    },
    handleInfiniteOnLoad() {
      if (this.firstInto) {
        this.firstInto = false
        return
      }
      this.loaddingFlag = true
      if ((this.projectList.records && this.projectList.records.length) >= this.projectList.total) {
        this.busy = true
        this.loaddingFlag = false
        return
      }
      this.pageNO += 1
      this.onChangepage(this.pageNO)
    },
    onChangepage(current, type) {
      const that = this
      queryWhenLeader({
        orderItems: this.currentOrderItems,
        pageNo: current,
        projectFirstClass: this.activeFirstCode,
        projectClass: this.activeCode,
        projectSubType: this.projectStatus || '',
        pageSize: 10,
        type: this.scheduleStatus,
        keyword: this.valueSearch,
        searchForm: JSON.stringify(this.searchForm),
        belongToStatus: this.belongToStatus,
        treeDeptId: this.treeSelectedKeys,
        subDeptIdByAtypeRoot: this.subDeptIdByAtypeRoot
      }).then((res) => {
        if (res && res.result && res.result.records.length > 0) {
          this.projectList.records = (this.projectList.records || []).concat(res.result.records)
          this.projectList.records.sort((a, b) => {
            return that.statusSortList.indexOf(b.projectStatus) - that.statusSortList.indexOf(a.projectStatus)
          })

          this.projectList.records.sort((a, b) => {
            if (a.projectSubType == 'TE' || b.projectSubType == 'TE') {
              if (a.projectSubType === b.projectSubType) {
                return 0
              } else {
                return a.projectSubType > b.projectSubType ? 1 : -1
              }
            }
          })
          this.lineTemplate = this.projectList.records.findIndex((item) => {
            return ['创建中', '已终止', '已转储'].includes(item.projectStatus)
          })

          this.projectList.total = res.result.total // projectList.total

          let proejctBuildIdList = []
          res.result.records.forEach((item) => {
            proejctBuildIdList.push(item.id)
          })
          this.getTimeLine(proejctBuildIdList)

          this.loaddingFlag = false
          this.busy = false
        } else {
          this.loaddingFlag = false
          this.busy = true
        }
      })
    },
    projectReportDetail(id, projectLevel) {
      //报工功能
      let urlJump = this.$router.resolve({ path: `/projectReportHome?projectBuildId=${id}` })
      window.open(urlJump.href, '_blank');
    },
    projectBudgetDetail(id) {
      //查看预算功能
      let urlJump = this.$router.resolve({ path: `/projectBudgetDetail?projectBuildId=${id}` })
      window.open(urlJump.href, '_blank');
    },
    projectTaskDetail(projectNo) {
      //查看任务功能
      window.open(
        this.HTE_OLD_SERVER_URL +
        `/projectBuildTask/index?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&searchKey=${projectNo}`,
        '_blank'
      )
    },
    projectDetail(id, status, projectType, projectAll, projectMember) {
      if (projectAll != 1 && projectMember != 1) {
        return
      }

      if (projectAll == 1) {
        var detailUrl =
          this.HTE_OLD_SERVER_URL +
          `/projectBuild/buildBasic?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&id=${id}&projectClassCode=${this.activeCode
          }&projectType=${this.projectType}`
        //查看明细功能
        let projectDetailUrl =
          status === 1
            ? detailUrl
            : status === 2 || status === 3
              ? this.HTE_OLD_SERVER_URL + `/projectBuild/audit?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&id=${id}`
              : this.HTE_OLD_SERVER_URL + `/projectBuild/auditDetail?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&id=${id}`
        window.open(projectDetailUrl, '_blank')
        return
      }
      if (projectMember == 1) {
        let urlJump = this.$router.resolve({ path: `/projectbuildstup/baseInfo?projectBuildId=` + id + '&projectMember=1' })
        window.open(urlJump.href, '_blank');
        return
      }
    },
    projectAuditDetail(id) {
      //审批状态功能
      window.open(
        this.HTE_OLD_SERVER_URL + `/projectAudit/auditProcess?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&id=${id}`,
        '_blank'
      )
    },
    fileJoinSignHistory(record) {
      this.fileJoinSign.projectBuildId = record.id
      this.fileJoinSign.projectNo = record.projectNo
      this.fileJoinSign.projectName = record.projectName
      let listData = []
      getAction('/fileJoinSign/list',{projectNo : record.projectNo,pageSize: -1}).then((res) => {
        if (res.code === 200) {
            listData = res.result.records || []
          } else {
            this.$message.error(res.message)
          }
          this.fileJoinSign.showHistoryList = true
          this.fileJoinSign.historyData = listData
      })
    },
    loadChangeRecord(){
      this.projectChangeDetail(this.currentRecord)
    },
    projectChangeDetail(record) {
      this.currentRecord = record
      var id = record.id
      var projectClass = record.projectClass
      this.projectAll = record.projectAll === 1
      this.isAdmin = record.projectAdmin === 1
      this.isMember = record.projectMember === 1
      var projectTypeSubCategory = record.projectTypeSubCategory
      if (['40','41'].indexOf(projectClass)>-1 && projectTypeSubCategory!="S") {
        this.openChangeRecordHistory(record)
        return 
      }
      /*if (projectClass == '40' || projectClass == '41') {
        this.projectChange.projectBuildId = id;
        this.projectChange.projectClass = projectClass;
        let vm = this;
        getAction('/projectChange/queryHistoryByBuildId', { projectBuildId: id }).then(res => {
          var result = res.result;
          let projectChangeData = result.newList || [];
          projectChangeData.forEach(function (item) {
            let changeContentArr = item.changeContent ? item.changeContent.split(",") : [];
            let budgetChangeContentArr = item.budgetChangeContent ? item.budgetChangeContent.split(",") : [];
            let changeContentNames = [], budgetChangeContentNames = [];
            changeContentArr.forEach(function (num) {
              changeContentNames.push(vm.projectChange.changeContentData[num]);
            });
            budgetChangeContentArr.forEach(function (num) {
              budgetChangeContentNames.push(vm.projectChange.budgetChangeContentData[num]);
            });
            item.changeContent = changeContentNames.join(",");
            item.budgetChangeContent = budgetChangeContentNames.join(",");
            item.statusName = vm.projectChange.statusData[item.status];
          });
          vm.projectChange.changeHistoryData = projectChangeData;
          vm.projectChange.showHistoryList = true;
        })
      } else {
        if (record.projectAll != 1 && record.projectAdmin != 1
          && record.changeCreater != null && record.changeCreater.length > 0 && record.changeCreater != this.userinfo.info.username) {
          this.$message.warning('该项目有进行的变更，不可重复发起')
          return;
        }
        //项目变更功能
        window.open(this.HTE_OLD_SERVER_URL + `/projectChange/add?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&projectBuildId=${id}`, "_blank");
      }*/
      this.projectChange.projectBuildId = id
      this.projectChange.projectClass = projectClass
      this.projectChange.projectStatus = record.status
      this.projectChange.projectType = record.projectTypeSubCategory
      let vm = this
      getAction('/projectChange/queryHistoryByBuildId', { projectBuildId: id }).then((res) => {
        var result = res.result
        let projectChangeData = result.newList || []
        projectChangeData.forEach(function (item) {
          let changeContentArr = item.changeContent ? item.changeContent.split(',') : []
          let budgetChangeContentArr = item.budgetChangeContent ? item.budgetChangeContent.split(',') : []
          let changeContentNames = [],
            budgetChangeContentNames = []
          changeContentArr.forEach(function (num) {
            changeContentNames.push(vm.projectChange.changeContentData[num])
          })
          budgetChangeContentArr.forEach(function (num) {
            budgetChangeContentNames.push(vm.projectChange.budgetChangeContentData[num])
          })
          item.changeContent = changeContentNames.join(',')
          item.budgetChangeContent = budgetChangeContentNames.join(',')
          item.statusName = vm.projectChange.statusData[item.status]
        })
        vm.projectChange.changeHistoryData = projectChangeData
        vm.projectChange.showHistoryList = true
      })
    },
    openChangeRecordHistory(record) {
      if (!record || !record.projectNo || !record.projectName) {
        return this.$message('请选选择项目编号')
      }
      this.$refs.ChangeRecordHistory.openInit(
        record.id,
        record.projectNo,
        record.projectName,
        record.projectManager
      )
    },
    projectReserveDetail (record) {
      let urlJump = this.$router.resolve({ path: '/projectBuildReserve?projectBuildId=' + record.id })
      window.open(urlJump.href, '_blank')
    },
    addChangeOrder() {
      //非工程类项目不能同时变更
      if (this.projectChange.projectClass != '40' && this.projectChange.projectClass != '41') {
        let checkData = this.projectChange.changeHistoryData.filter((c) => {
          return c.status == 1
        })
        if (checkData && checkData.length > 0) {
          this.$message.warning('该项目有进行中的变更单，不可重复创建')
          return
        }
      }
      if(["40","41"].indexOf(this.projectChange.projectClass)>-1){
         let urlJump = this.$router.resolve({ path: '/projectChange/changeRecord?projectBuildId='+this.projectChange.projectBuildId+'&pageId=8' })
          window.open(urlJump.href, '_blank')
          return;
      }
      getAction('/projectChange/create', { projectBuildId: this.projectChange.projectBuildId }).then(res => {
        if (res.success) {
          let urlJump = this.$router.resolve({ path: `/projectbuildstup/changeRecord?projectBuildId=${this.projectChange.projectBuildId}&pageId=8&changeId=${res.result.id}` })
          window.open(urlJump.href, '_blank')
        } else {
          this.$message.warning('新增变更单失败：' + res.message);
        }
      }).catch(err => {
        this.$message.warning('新增变更单失败：' + err.message);
      })
    },
    projectReserve() {
      let urlJump = this.$router.resolve({ path: '/projectBuildReserve?projectBuildId=' + this.projectChange.projectBuildId })
      window.open(urlJump.href, '_blank')
    },
    showChangeDetail(changeId, createUserId, status) {
      if (this.projectAll || this.isAdmin || this.isMember) {
        if (!this.projectAll && !this.isAdmin && this.userinfo.info.username != createUserId) {
          this.$message.warning('项目成员只能查看自己创建的变更单')
          return
        }
        let jumpUrl = "/projectbuildstup/changeRecord"
          if(["40","41"].indexOf(this.projectChange.projectClass)>-1){
            jumpUrl = "/projectChange/changeRecord"
          }
        if (status > 1) {
          // window.open('/changeDetail?projectBuildId='+this.projectChange.projectBuildId+"&id="+changeId);
          
          let urlJump = this.$router.resolve({ path: jumpUrl+'?projectBuildId='+this.projectChange.projectBuildId+'&pageId=8&changeId='+changeId })
          window.open(urlJump.href, '_blank')
          return;
        }
        if (this.userinfo.info.username != createUserId && !this.isAdmin) {
          this.$message.warning('非管理员不能查看她人创建中的变更单')
          return
        }
        let urlJump = this.$router.resolve({ path: jumpUrl+'?projectBuildId='+this.projectChange.projectBuildId+'&pageId=8&changeId='+changeId })
        window.open(urlJump.href, '_blank')
      } else {
        this.$message.warning('非该项目成员和管理员，无法操作')
      }
    },
    projectAudit() {
      //待审批功能
      window.open(
        this.HTE_OLD_SERVER_URL + `/report/indexToAudit?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&status=2`,
        '_blank'
      )
    },
    projectHatch() {
      //孵化项目功能
      if (!this.activeFirstCode) {
        this.visibleFh = true
        this.showPopFirstClassFh = true
        this.showPopClassFh = false
        this.selectedClassFh = ''
        this.selectedFirstClassFh = ''
        return
      }
      if (!this.activeCode) {
        this.visibleFh = true
        this.showPopFirstClassFh = false
        this.showPopClassFh = true
        this.selectedClassFh = ''
        this.selectedFirstClassFh = ''
        return
      }
      if (this.activeCode == '62' && this.projectStatus=='MG') {
        let urlJump = this.$router.resolve({ path: '/hatchIndex' })
        window.open(urlJump.href, '_blank')
      } else if(this.activeCode == '62'){
        this.visibleFh = true
        this.showPopFirstClassFh = false
        this.showPopClassFh = true
        this.selectedClassFh = ''
        this.selectedFirstClassFh = ''
        this.selectedTypeFh=''
        return
      }else {
        window.open(
          this.HTE_OLD_SERVER_URL +
          `/hatchProject/index?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&projectClass=${this.activeCode}`
        )
      }
    },
    projectBuild() {
      if (!this.activeFirstCode) {
        this.visible = true
        this.showFirstPopClass = true
        this.showPopClass = false
        this.showPopType = false
        this.projectStatus = ''
        this.selectedFirstClass = ''
        this.selectedClass = ''
        this.selectedType = ''
        return
      }
      if (!this.activeCode) {
        this.visible = true
        this.showFirstPopClass = false
        this.showPopClass = true
        this.showPopType = false
        this.projectStatus = ''
        this.selectedFirstClass = ''
        this.selectedClass = ''
        this.selectedType = ''
        return
      }
      if (['10','20','40','62','80'].includes(this.activeCode) && !this.projectStatus) {
        this.selectedType = ''
        this.visible = true
        this.showFirstPopClass = false
        this.showPopClass = false
        this.showPopType = true
        return
      }
      //我要立项功能
      let urlJump = this.$router.resolve({ path: `/projectbuildstup/baseInfo?projectClass=${this.activeCode}` + '&projectType=' + this.projectStatus })
      window.open(urlJump.href, '_blank')
    },
    handleOk(e) {
      if (!this.activeFirstCode) {
        this.$message.warning('请先选择项目一级分类')
        return
      }
      if (!this.activeCode) {
        this.$message.warning('请先选择项目二级分类')
        return
      }
      if ( ['10','20','40','62','80'].includes(this.activeCode) && !this.selectedType ) {
        this.$message.warning('请先选择项目三级分类')
        return
      }
      this.visible = false;
      let urlJump = this.$router.resolve({ path: `/projectbuildstup/baseInfo?projectClass=${this.activeCode}` + '&projectType=' + this.selectedType })
      window.open(urlJump.href, '_blank')
    },
    handleOkFh(e) {
      if (!this.activeFirstCode) {
        this.$message.warning('请先选择项目一级分类')
        return
      }
      if (!this.activeCode) {
        this.$message.warning('请先选择项目二级分类')
        return
      }
      if(this.activeCode === '62'&&!this.selectedTypeFh){
        this.$message.warning('请先选择项目三级分类')
        return
      }
      this.visibleFh = false
      if(this.selectedTypeFh&&this.selectedTypeFh==='MG'){
        let urlJump = this.$router.resolve({ path: '/hatchIndex' })
        window.open(urlJump.href, '_blank')
      }else{
        window.open(
          this.HTE_OLD_SERVER_URL +
          `/hatchProject/index?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&projectClass=${this.activeCode}`
        )
      }
    },
    handleFirstClassChange(value) {
      this.showPopClass = true
      this.showPopType = false
      this.selectedType = ''
      this.selectedClass = ''
      this.activeFirstCode = value
      this.getProjectTypeByActiveFirstCode()
      if (value == 'Z') {
        this.showSubTypeListByZ()
      } else {
        this.showSubType = false
      }
    },
    handleClassChange(value) {
      if (['10','20','40','62','80'].includes(value)) {
        this.showPopType = true
        this.selectedType = ''
      } else {
        this.showPopType = false
      }
      this.activeCode = value
      if (!value) {
        this.showSubTypeListByZ()
      } else {
        this.getSelectSubTypeByActiveCode()
      }
      if (this.activeFirstCode == 'Z' || ['62','80'].includes(value)) {
        this.showSubType = true
      } else {
        this.showSubType = false
      }
    },
    handleTypeChange(value) {
      this.projectStatus = value
    },
    handleFirstClassChangeFh(value) {
      this.activeFirstCode = value
      this.showPopClassFh = true
      this.getProjectTypeByActiveFirstCode()
      if (value == 'Z') {
        this.showSubTypeListByZ()
      } else {
        this.showSubType = false
      }
    },
    handleClassChangeFh(value) {
      this.activeCode = value
      if (['62','80'].includes(value)) {
        this.showPopTypeFh = true
        this.selectedType = ''
        this.showSubType=true;
      } else {
        this.showPopTypeFh = false
        this.showSubType=false;
      }
      this.getSelectSubTypeByActiveCode()
    },
    projectBudgetLink() {
      //项目预算功能
      // window.open(this.HTE_OLD_SERVER_URL + `/report/index?bootToken=${Vue.ls.get(ACCESS_TOKEN)}&status=4&type=budget`)
      let urlJump = this.$router.resolve({ path: '/budget/orderList' })
      window.open(urlJump.href, '_blank')
    },
    projectFileJoinSignLink() {
      let urlJump = this.$router.resolve({ path: '/fileJoinSignIndex' })
      window.open(urlJump.href, '_blank')
    },
    projectTask() {
      //项目任务单功能
      window.open(this.HTE_OLD_SERVER_URL + `/projectBuildTask/index?bootToken=${Vue.ls.get(ACCESS_TOKEN)}`)
    },
    projectInvite() {
      //我的邀约功能
      window.open(this.HTE_OLD_SERVER_URL + `/myLaunchInvite/index?bootToken=${Vue.ls.get(ACCESS_TOKEN)}`)
    },
    applyInvitation() {
      //我要应约功能
      window.open(this.HTE_OLD_SERVER_URL + `/myProjectInvite/index?bootToken=${Vue.ls.get(ACCESS_TOKEN)}`)
    },
    tcGroupBy () {
      let urlJump = this.$router.resolve({ path: '/tcSummaryLookByEc' })
      window.open(urlJump.href, '_blank')
    },
    togoGuidanceDoc () {
      let urlJump = this.$router.resolve({ path: '/projectGuidanceDoc' })
      window.open(urlJump.href, '_blank')
    },
    summaryProject(){
      let urlJump = this.$router.resolve({ path: '/allSummary' })
      window.open(urlJump.href, '_blank')
    },
    gotoCenter(){
      let urlJump = this.$router.resolve({ path: '/reportCenter' })
      window.open(urlJump.href, '_blank')
    },
    toProjectCompleteAccept(){
      let urlJump = this.$router.resolve({ path: '/projectCompleteAcceptList' })
      window.open(urlJump.href, '_blank')
    },
    gotoOtherHref(url){
      let urlJump = this.$router.resolve({ path: url })
      window.open(urlJump.href, '_blank')
    },
    info() {
      const h = this.$createElement
      this.$info({
        title: 'Hello，该模块正在火热建设中，暂时未上线',
        onOk() { },
      })
    },
    toContractList(projectNo, projectClass) {
      if (projectNo) {
        if (projectClass == '40') {
          let urlJump = this.$router.resolve({ path: "/contract/list/" + projectNo })
          window.open(urlJump.href, '_blank')
        } else {
          this.contractData.contractList = []
          this.contractData.showContract = true
          getAction(this.contractData.queryUrl, { projectNo: projectNo }).then((res) => {
            if (res.success) {
              this.contractData.contractList = res.result || []
            }
          })
        }
      }
    },
    toOneCilckRemind(id) {
      const _this = this
      this.$confirm({
        title: '是否发送一键提醒未报工的处理人?',
        onOk() {
          getAction('/projectBuild/oneClickRemind', { projectBuildId: id }).then((res) => {
            if (res.code == 200) {
              _this.$message.success('一键提醒发送成功')
            } else {
              _this.$message.warning('一键提醒发送失败:' + res.message)
            }
          })
        },
      })
    },
    jumpOpen (type) {
      if(type=='1'){
        this.windowOpen("/workReport/projectList" )
      }else if(type=='2'){
        this.windowOpen("/workReport/myTaskList" )
      } else if(type=='3'){
        this.windowOpen("/workReport/paymentList" )
      } else if(type=='4'){
        this.windowOpen("/workReport/qualityList" )
      }else if(type=='5'){
        this.windowOpen("/infrastructure/list" )
      }else if(type=='6'){
        let urlJump = process.env.VUE_APP_HLPS_WEB_BASE_URL +
          '/' +
          'tpLogin?token=' +
          this.$ls.get(ACCESS_TOKEN) +
          '&tp=hs&redirect=' +
          encodeURIComponent('/guide/index')
          window.open(urlJump, '_blank');
          return;
      }
      else if(type=='11'){
          this.windowOpen('/projectCompleteAcceptList')
          return;
      }
      else if(type=='12'){
          this.windowOpen('/projectChangeList')
          return;
      }
      else if(type=='13'){
          this.windowOpen('/purchaseApplyList')
          return;
      }
      else if(type=='14'){
          this.windowOpen('/reward/applyList')
          return;
      }
    },
    seeTimeMore(item) {    
      const {id, projectManager, projectClass, status, projectAll, projectReport, projectNo, projectName} = item
      let urlJump = this.$router.resolve({ path: `/projectGantt?id=${id}&pm=${projectManager}&pc=${projectClass}&status=${status}&pa=${projectAll}&pr=${projectReport}&no=${projectNo}&name=${projectName}` })
      window.open(urlJump.href, '_blank')
    },
    handleToSearch() {
      this.projectList = []
      this.scheduleStatus = null
      this.belongToStatus = null
      this.emptyFlag = false
      this.getCategoryList(this.defaultOrderItems)
      this.showSearchForm = false
    },
    clearSearch() {
      this.searchForm = {}
      this.applyDate = null
    },
    handleToCancel() {
      this.showSearchForm = false
    },
    openSearchForm() {
      this.showSearchForm = true
    },
    handleGoFile(item) {
      if (!item.additionalField) {
        let urlJump = this.$router.resolve({ path: `/library/index/4?type=${item.parentid}` })
        window.open(urlJump.href, '_blank')
      } else {
        let urlJump = this.$router.resolve({ path: `/library/file/view/4/${item.parentid}/${item.additionalField}` })
        window.open(urlJump.href, '_blank')
      }
    },
    toMaterialsConsum(){
      let urlJump = this.$router.resolve({ path: "/materials/list" });
      window.open(urlJump.href, "_blank")
    },
    toMaterialsSearch(){
      let urlJump = this.$router.resolve({ path: "/materials/search" });
      window.open(urlJump.href, "_blank")
    },
    openTtaskListByApproval(record) {
      const flag = record.projectAll === 1 || record.projectAdmin === 1 ? true : false
      this.$refs.taskListByApprovalTimeNode.doSelect(record.id, flag)
    },
    /**
     * 奖励申请相关方法
     */
    showRewardApplyWin(build) {
      if(build.projectClass=='10'){
        this.$refs.tip.handleShow(build.id)
      }else if(build.projectClass=='30'){
        //信息化项目直接进入
        ///reward/applyinfo
        let urlJump = this.$router.resolve({ path: "/reward/applyinfo?projectBuildId="+build.id });
        window.open(urlJump.href, "_blank")
      }else if(build.projectClass=='40'){
        //工程项目
       this.$refs.tip40.handleShow(build.id)
      }

    },
    /**
     * 跳转项目关闭页面
     */
    toProjectClose(build) {
      window.open('/projectClose?projectBuildId=' + build.id)
    },
    projectTechEngineeList(build){
      this.$refs.SubTechEngineeList.init(build.projectNo,build.projectClass)
    },
    openHteFilePopList(record){
      this.$refs.HteFilePopList.openInit(record.id,record.projectNo,record.projectType,record.projectLevel)
    },
    openHteDoneTipList(record){
      this.$refs.DoneTipList.openInit(record)
    },
    /**
     * 机构树 
     */
    getTreeData(){
      var vm = this
      postAction('/home/projectDeptTree')
        .then((res) => {
          if (res.code == 200) {                     
            this.flattenTreeDep(res.result)
            vm.treeData = res.result || []  
            this.treeLoading = false
          } else {
            this.$message.warning('查询产品系统失败:' + res.message)
          }
        })
        .catch((res) => {
          this.$message.warning('查询产品系统失败:' + res.message)
        })
    },
    flattenTreeDep(tdata) {
      if (Array.isArray(tdata) && tdata.length > 0) {
        tdata.forEach((v) =>{
          v.disabled = !v.selectable
          if (v.children && v.children.length) {
            this.flattenTreeDep(v.children);
          }          
        });
      }
    },
    onSelectClass(selectedKeys,e,event) { 
      if (this.loadingFlag) {
        this.$message.warning('正在查询，请稍后')
        return
      }
      if(selectedKeys.key == this.treeSelectedKeys || !selectedKeys.selectable){
        return
      } else {
        this.subDeptIdByAtypeRoot = e.data.slotTitle && selectedKeys.key > 0 ? e.data.slotTitle.split(",") : []
        this.treeSelectedKeys = selectedKeys.key
      }
      this.getCategoryList(this.defaultOrderItems)
    },
    showMenu(item,e,index){
       const menuMinWidth = 105
      const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
      const offsetWidth = this.$el.offsetWidth // container width
      const maxLeft = offsetWidth - menuMinWidth // left boundary
      const left = e.clientX - offsetLeft + 15 // 15: margin right
      this.selectedIndex = index
      if (left > maxLeft) {
        this.left = maxLeft
      } else {
        this.left = left
      }
      this.top = e.clientY
      this.selectedTag = item
      if(filterHasPermission(['projectBuild:operator'])){
        this.showContextmenu = true
      }
    },
    updateStatus(){
      if(this.selectedTag){
        this.changeStatus = this.selectedTag.status+""
        this.showUpdateStatus = true
      }
      this.showContextmenu = false
    },
    updateStatusHandler(){
      getAction(this.urls.changeStatus+"?projectId="+this.selectedTag.id+"&status="+this.changeStatus).then(res=>{
        if(res.success){
          this.$message.success('更新成功')
          this.handleToSearch()
        }else{
          this.$message.error('更新失败')
        }
      })
      this.showUpdateStatus = false
    },
    addFileJoinSign(record) {
      getAction('/fileJoinSign/queryByProjectBuildId?projectBuildId='+ this.fileJoinSign.projectBuildId).then(res=>{
         if (res.code == 200) {
          let list = res.result || []
          let resultList = list.filter(item => {return item.status != 2});
          if (list.lengrh == 0 || resultList.length == 0) {
            let url = '/fileJoinSignAdd?projectBuildId='+ this.fileJoinSign.projectBuildId +'&projectNo='+this.fileJoinSign.projectNo+'&projectName='+this.fileJoinSign.projectName
            let urlJump = this.$router.resolve({ path: url })
            window.open(urlJump.href, '_blank')
            return
          } else {
            this.$message.error('本项目有会审单未完成，不可新发起')
          }
         }
      })
    },
    delFileJoinSign(record) {
      if (this.selectedRowKeys.length == 0) {
        this.$message.warning('请选择要删除的技术会审记录')
        return
      }
      postAction('/fileJoinSign/delBatch', this.selectedRowKeys)
        .then((res) => {
          if (res.code == 200) {
            this.$message.success('删除技术会审记录成功')
            this.selectedRows = []
            this.selectedRowKeys = []
            this.fileJoinSign.showHistoryList = false
          } else {
            this.$message.warning('删除技术会审记录失败:' + res.message)
          }
        })
        .catch((res) => {
          this.$message.warning('删除技术会审记录异常:' + res.message)
        })
    },
    openFileJoinSignAdd(billNo) {
      let urlJump = this.$router.resolve({ path: `/fileJoinSignAdd?billNo=${billNo}` })
      window.open(urlJump.href, '_blank')
    },
    projectDoneShow(item) {
      if (item.projectClass=='10') {
        if (item.status == 10) {
          return true
        }
        if (item.realTimeLineList && item.realTimeLineList.length > 0) {
            let arr = item.realTimeLineList.filter(timeItem => {
              if (item.projectSubType == 'TE' && timeItem.timeNodeCode == '30' && timeItem.finishReport == 1) {
                return true
              }
              if (item.projectSubType != 'TE' && ['50','60'].includes( timeItem.timeNodeCode) && timeItem.finishReport == 1) {
                return true
              }
              return false
            })
            if (arr && arr.length > 0) {
              return true
            }
        }
      }
      return false
    }
  },
}
</script>
<style lang="less">
.new-tooltip {
  max-width: 600px !important;
}

.dropdown-class {
  width: 118px;
  background-color: #2a8fcb;
  border: solid 1px #2a8fcb;

  .ant-dropdown-menu {
    background-color: #2a8fcb;
    box-shadow: 0 0 0 0;
    padding: 0px 0;

    .ant-dropdown-menu-item {
      line-height: 30px;
      // > a{
      //       color: #fff
      //   }
      color: #fff;
    }

    .ant-dropdown-menu-submenu-title {
      color: #fff;
    }

    .ant-dropdown-menu-item:hover,
    .ant-dropdown-menu-submenu-title:hover {
      color: #2a8fcb;
    }

    .ant-dropdown-menu-item:hover,
    .ant-dropdown-menu-submenu-title:hover,
    .ant-dropdown-menu-submenu-title:hover {
      color: #2a8fcb;
      background-color: #fff;
    }

    .ant-dropdown-menu-submenu-arrow>svg {
      color: #fff;
    }
  }

  .ant-dropdown-menu-submenu-popup {
    >.ant-dropdown-menu {
      background-color: #fff;
      box-shadow: 0 0 0 0;
      padding: 0px 0;
      border-radius: 0;
      border: solid 1px #2a8fcb;

      >.ant-dropdown-menu-item {
        color: black;
      }
    }

    .ant-dropdown-menu-item:hover,
    .ant-dropdown-menu-submenu-title:hover {
      color: #2a8fcb;
      font-weight: bold;
    }
  }
}
</style>
<style lang="less" scoped>
@import '~@assets/less/hte-main.less';

.mb10 {
  margin-bottom: 10px;
}

.project-pavilion {
  background: #f5f5f5;
  height: 100%;

  .iconfont {
    font-size: 14px;

    &.icon-dingdan {
      font-size: 15px;
    }
  }

  .banner {
    height: 80px;
    background-image: url('../assets/banner-top1.png');
  }

  .banner1 {
    height: 80px;
    background-image: url('../assets/banner-top2.png');
  }

  .tabs-box {
    padding: 20px 125px 100px;
    background: #f5f5f5;
    height: fit-content;

    .hoverShow {
      padding: 10px;
      cursor: pointer;
      border-bottom: 3px solid rgba(255, 255, 255, 0);
      position: relative;

      &:after {
        content: '';
        position: absolute;
        bottom: -3px;
        left: 0;
        width: 100%;
        height: 3px;
      }

      &.clickShow {
        color: #0988dc;
        font-weight: bold;
      }

      &:hover,
      &.clickShow {
        &:after {
          background-color: #0988dc;
        }
      }
    }

    .projec-class-list-more .hoverShow:after {
      bottom: -2px;
    }

    .projectStatusColor1 {
      background-color: #9db7f0;
    }

    .projectStatusColor2 {
      background-color: #f0a0a0;
    }

    .projectStatusColor3 {
      background-color: #73ae81;
    }

    .projectStatusColor4 {
      background-color: #73ae81;
    }

    .projectStatusColor5 {
      background-color: #5bc4d4;
    }

    .projectStatusColor6 {
      background-color: #f2b56d;
    }

    .projectStatusColor7 {
      background-color: #bdbec0;
    }

    .projectStatusColor8 {
      background-color: #f2b56d;
    }
    .projectStatusColor9 {
      background-color: #bdbec0;
    }

    .projectStatusColor10 {
      background-color: rgba(0, 0, 0, 0.6);
    }

    ul {
      list-style: none;
      margin: 0;
      display: flex;
      align-items: center;
    }

    .cascade {
      background: #fff;
      border: 1px solid #e2e2e2;
      border-bottom: none;
      border-radius: 2px;
      color: #52687a;

      .projec-class-box {
        display: flex;
        align-items: center;
        padding-left: 10px;

        .projec-class-lable {
          padding: 10px;
          text-align: center;
          font-weight: bold;
        }

        .projec-class-list {
          width: calc(100% - 100px);
          padding-left: 10px;
          color: #666;
          padding: 0;
          flex-wrap: wrap;
        }

        .btn-more {
          display: none;
        }

        &.project-class-more {
          padding-right: 63px;
          position: relative;

          .btn-more {
            display: inline-block;
            position: absolute;
            right: 2px;
            width: auto;
          }

          ul {
            transition: max-height 0.3s;
            overflow: hidden;
            max-height: 700px;

            &.projec-class-list-more {
              max-height: 43px;
            }
          }
        }
      }

      .floatNav {
        position: fixed;
        right: 30px;
        z-index: 1;

        >div {
          display: flex;
          flex-direction: column;
          align-items: center;
          padding: 7px;
          cursor: pointer;
          border: 1px solid #31A0E1;
          color: #31A0E1;
          margin-bottom: 6px;
          border-radius: 4px;
          background: #fff;
          p {
            margin-bottom: 0;
            width: 56px;line-height: 14px;
          }
          .iconfont {
            color: #31A0E1;font-size: 19px;transition: all 0.3s;
          }
          &:hover {
            background-color: #e6f7ff;
            .iconfont {
              transform: scale(1.2);
            }
          }
          &.tab-project,&.tab-Hatch{color: #fff;
            .iconfont{color: #fff;}
            &:hover{
              p{color: #fff;}
            }
          }
          &.tab-project{
            background: #E27647;
            border-color: #E27647;
            
          }
          &.tab-Hatch{
            background: #42BCA7;
            border-color: #42BCA7;
            .iconfont{transform: scale(1.2);}
            &:hover{
              .iconfont {
                transform: scale(1.4);
              }
            }            
          }
        }
      }
    }
    .project-info {
      .baseSize {
        display: inline-block;
        min-width: 1.5em;
        color: #42a2fc;
      }

      .fontred {
        color: #f34141;
      }

      .fontgreen {
        color: #76c1b4;
      }

      .fontpurple {
        color: #ae81ff;
      }

      .fontgrey {
        color: grey;
      }

      .info-title {
        display: flex;
        justify-content: space-between;
        align-items: center;

        .left-side {
          color: #52687a;
          padding-left: 10px;
          margin-left: -15px;
          flex-wrap: wrap;

          li {
            padding: 10px 5px;

            span {
              &:first-of-type {
                padding-right: 3px;
              }

              &.btn-sort {
                cursor: pointer;

                &:hover {
                  opacity: 0.8;
                }
              }
              .iconfont{font-size: 12px}
            }
          }
        }

        .right-side {
          display: flex;
          justify-content: flex-end;
          padding: 10px 0;
          flex-wrap: nowrap;

          >div {
            width: 53px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            border: solid 1px #cccccc;
            color: #666666;
            cursor: pointer;
            font-size: 13px;

            &:last-child {
              border-radius: 0px 2px 2px 0px;
            }

            &:first-child {
              border-radius: 2px 0px 0px 2px;
            }

            &.active {
              background-color: #98bacc;
              border: solid 1px #a0bac8;
              color: #fff;
            }

            >i {
              margin-right: 4px;
            }

            &:hover {
              opacity: 0.8;
            }
          }
        }
      }
      >.flex{display: flex;
        .tree{background-color: #409EFF;margin-right: 10px;min-height:300px}
        >ul{flex:1;overflow: hidden;}
      }

      .project-list {
        display: flex;
        flex-direction: column;

        >li {          
          background: #fff;
          width: 100%;
          padding: 5px 0 5px 27px;
          margin-bottom: 10px;
          &:last-of-type{margin-bottom: 0}
          >div{
            display: flex;
            align-items: center;
            justify-content: space-between;
          }
        }

        .synopsis {          
          padding: 23px 0 0;
          ul {
            padding: 0;
            flex-wrap: wrap;

            li {
              padding-right: 10px;
              cursor: pointer;

              &:hover {
                opacity: 0.8;
              }
            }

            .fontbase {
              margin-right: 3px;
            }
          }
        }

        .process {
          padding: 0;
          width: 62%;
          margin-right: 48px;

          ul {
            padding: 0;
            display: flex;
            justify-content: flex-end;

            li {
              display: flex;
              flex-direction: column;
              width: 140px;
              min-width: 50px;
              align-items: center;
              position: relative;

              >span {
                // drcary
                display: block;
                height: 51px;
                width:100%;
                padding: 0 5px 18px;
                margin-bottom: -16px;
                font-size: 13px;
                display: flex;
                align-items: center;
                flex-wrap:wrap;
                justify-content: center;
                line-height: 1;position:relative;
                >span{transform: scale(0.9);width: 200%;position: absolute;top: 22px;text-align: center;}
              }

              .content-box {
                width: 100%;
                display: flex;
                justify-content: center;
                align-items: center;
                position: relative;

                &:after {
                  width: 100%;
                  height: 1px;
                  border-top: 1px dashed #bcbcbc;
                  left: -50%;
                  top: 50%;
                }
              }

              .infobox {
                display: flex;
                flex-direction: column;
                align-items: center;
                color: #787878;
                padding-top: 6px;

                span {
                  white-space: nowrap;
                  overflow: hidden;
                  text-overflow: ellipsis;
                  max-height: 56px;
                }

                p {
                  font-size: 12px;
                  color: #999;
                  margin-bottom: 0;
                }
              }

              &:first-of-type {
                .content-box:after {
                  display: none;
                }
              }
            }
          }
        }
        .btn-more{margin-top: -8px;width: 61px;transform: scale(0.9);}
      }

      .loaddingbox {
        width: inherit;
        text-align: center;
        padding-left: 190px;
        padding-top: 20px;
      }

      .tips-box {
        width: 100%;
        text-align: center;
        padding-left: 190px;
        padding-top: 20px;

        &.tips-box-more {
          cursor: pointer;

          &:hover {
            opacity: 0.8;
            color: #0581ca;
          }
        }
      }
    }

    .project-card {
      flex-wrap: wrap;
      margin: 0 -5px;
      align-items: self-start;

      >li {
        padding: 16px 16px 10px;
        width: calc((100% - 50px) / 5);
        margin: 0px 5px 10px;

        .synopsis {
          padding-left: 6px;

          h3,
          p {
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
            margin-bottom: 0;
            margin-top: 0;
          }
        }

        .process {
          background-color: #fafcfc;
          border-radius: 4px;
          border: solid 1px #e5e5e5;
          padding: 10px;
          margin: 5px 0 10px;
          height: 223px;
          display: flex;

          ul {
            padding: 0;
            flex-wrap: wrap;
          }

          li {
            width: 100%;
            margin-bottom: 15px;

            .content-box {
              display: inline-block;
              position: relative;
              top: 2px;

              &:after {
                height: 200%;
                width: 1px;
                border-left: 1px dashed #bcbcbc;
                left: 8px;
                top: 17px;
              }
            }

            span:not(.content-box) {
              font-size: 12px;
            }

            span.node {
              font-size: 14px;
              color: #666;
              padding: 0 10px;
              display: inline-block;
            }

            .infobox {
              color: #999;
              padding-right: 10px;
            }

            .btn-more {
              background-color: #fafcfc;
              border-radius: 16px;
              border: solid 1px #cccccc;
              padding: 0 7px;
              font-size: 12px;
              position: relative;
              z-index: 1;
              width: auto;

              &:hover {
                border-color: #0581ca;
                background-color: #fafcfc;
              }
            }

            &:last-of-type {
              margin-bottom: 0;
            }

            &.li-less2 .content-box:after {
              height: 400%;
            }

            &.li-less1 .content-box:after {
              height: 550%;
            }
          }
        }

        .btn-group {
          padding: 0;
          flex-wrap: wrap;
          margin-right: -10px;

          li {
            margin-right: 6px;
            cursor: pointer;

            &:hover {
              color: #0581ca;

              .iconfont {
                opacity: 0.8;
              }
            }
          }
        }
      }
    }
  }

  .project-list,
  .project-card {
    padding: 0;position: relative;
    .skeleton{width: 100%;position: absolute;top: 0;left: 0;background: #f5f5f5;z-index: 1;height: 100%;}
    >li {
      border: 1px solid #e6e6e6;
      border-radius: 4px;
      transition: transform 0.2s ease-out;
      overflow: hidden;
      color: #666;
      position: relative;
      background-color: #ffffff;

      &:hover {
        box-shadow: 0 4px 8px 0 #e6e6e6;
        transform: translateY(-2px);
      }
      h3 {
        font-weight: 700;
        color: #555555;
        margin-bottom: -10px;
        margin-top: 7px;
      }
      .synopsis .level span, h3 >span span {
        color: #fcb202;
      }
      .process ul li .content-box {
        &.greencircle {
          .circle {
            border-color: #3fa883;
            position: relative;

            &:before {
              content: '';
              position: absolute;
              width: 10px;
              height: 10px;
              border-radius: 100%;
              background-color: #3fa883;
            }
          }

          &:after {
            border-color: #3fa883 !important;
          }
        }

        &.redblankcir {
          .circle {
            border-color: #f17777;
          }

          &:after {
            border-color: #f17777 !important;
          }
        }

        .circle {
          width: 16px;
          height: 16px;
          border-radius: 100%;
          border: 1px solid #bcbcbc;
          background-color: #fff;
          display: flex;
          align-items: center;
          justify-content: center;
          position: relative;
          z-index: 1;
        }

        &:after {
          content: '';
          position: absolute;
        }
      }
    }

    .fontbase {
      color: #77b9f1;
      margin-right: 2px;
    }

    .status-box {
      width: 100px;
      height: 16px;
      line-height: 17px;
      color: #fff;
      font-size: 12px;
      text-align: center;
      transform: rotate(-45deg);
      top: 7px;
      left: -35px;
      position: absolute;
      overflow: hidden;

      span {
        transform: scale(0.8);
        display: inline-block;
      }
    }

    /deep/ .ant-divider-dashed {
      font-size: 13px;
      color: #888;
      padding: 0 8px 5px;

      &:before,
      &:after {
        border-top: 1px dashed #999;
        top: 0;
      }
    }
  } 
  .icon-child-down {
    font-size: 11px;
    transition: all 0.3s;
    color: #999;

    &.icon-child-up {
      transform: rotate(180deg);
    }
  }

  .btn-more {
    cursor: pointer;
    color: #999;
    display: inline-block;
    font-weight: normal;
    width: 52px;
    padding: 0 4px;
    text-align: center;
    font-size: 13px;
    padding: 0 4px;
    margin-left: 5px;
    position: absolute;
    right: 2px;
    z-index: 1;
    &:hover {
      color: #0581ca;
      background-color: #e4e4e4;

      .icon-child-down {
        color: #0581ca;
      }
    }
  }

  .hte-nav-tap {
    background-color: #fff;
    border: 1px solid #e2e2e2;
    font-size: 12px;
    color: #b3b3b3;
    border-top-color: #f2f2f2;
    border-radius: 2px;

    &.border-nav-top {
      border-top-color: #e2e2e2;
    }

    >span {
      padding: 5px;

      &:hover {
        background-color: #fff;
      }
    }
  }
}

@media only screen and (max-width: 1700px) {
  .project-pavilion .tabs-box .project-card>li {
    width: calc((100% - 40px) / 4);
  }
}

@media only screen and (max-width: 1576px) {
  .project-pavilion .tabs-box .project-card>li {
    width: calc((100% - 30px) / 3);
  }
}

@media only screen and (max-width: 1100px) {
  .project-pavilion .tabs-box .project-card>li {
    width: calc((100% - 20px) / 2);
  }
}

/deep/.ant-carousel .slick-slide {
  text-align: center;
  height: 80px;
  line-height: 80px;
  overflow: hidden;
  border: 1px;
}

/deep/.ant-carousel .custom-slick-arrow {
  width: 25px;
  height: 25px;
  font-size: 25px;
  color: black;
  background-color: rgba(31, 45, 61, 0.11);
  opacity: 0.3;
}

/deep/.ant-carousel .custom-slick-arrow:before {
  display: none;
}

/deep/.ant-carousel .custom-slick-arrow:hover {
  opacity: 0.5;
}

/deep/.ant-carousel .slick-slide h3 {
  color: #364d79;
}

.pop-control {
  height: 38px;
  display: flex;
  align-items: center;
  color: #ffffff;
  margin: 0;
  padding: 0;
  background-color: #31a0e1;
  border-radius: 2px;

  .pop-hoverShow {
    cursor: pointer;
    position: relative;
    padding: 0 2.5%;
    min-width: 68px;
    text-align: center;
    height: 100%;
    display: inline-block;
    line-height: 38px;

    &.clickShow {
      background-color: #0581ca;
      font-weight: lighter;
    }
  }

  >li {
    display: flex;
    align-items: center;
    font-family: Source Han Sans CN;
    font-size: 16px;
    // font-weight: bold;
    font-stretch: normal;
    color: #ffffff;

    position: relative;
    padding: 0 30px;
    cursor: pointer;

    &:hover {
      background-color: #0581ca;
    }
  }
}

.changeHand {
  &:hover {
    cursor: pointer;
  }
}

/deep/ .ant-modal-body {
  .ant-row {
    margin-bottom: 20px;

    &:last-of-type {
      margin-bottom: 0;
    }
  }
}

@media screen and (max-width: 1300px) {
  .project-pavilion div.tabs-box {
    padding: 20px 77px 100px 30px;
    .cascade div.floatNav {
      right: 8px;
      top: 169px;
    } 
  }
  .project-pavilion .tabs-box .cascade .floatNav > div{
    font-size: 12px;
    padding: 3px 0px;
    p{text-align: center;}
  }  
  /deep/.ant-badge{font-size: 12px;}
  .project-pavilion .tabs-box .project-info .project-list .process{overflow: hidden;
    ul{justify-content: flex-start;
      li{min-width: 70px;}
    }
  }
}
/deep/.level .ant-tag,/deep/.hte-text-downline .ant-tag{
  margin-left: 10px
}
.color-code3,
.color-code2,
.color-code4 {
  display: inline-block;
  border-radius: 5px;
  font-size: 12px;
  line-height: 12px;
  font-weight: 700;
  padding: 5px 15px;
  margin-left: 10px;
  vertical-align: top;
  transform: scale(0.9);
}

.color-code3 {
  color: #606266 !important;
  background: #f77077;
  border: 1px solid #dd6161;
}

.color-code2 {
  color: #606266 !important;
  background: #ffeb00;
  border: 1px solid #db804c;
}
.color-code4 {
  color: #606266 !important;
  background: #E27647;
  border: 1px solid #f15a19;
}
.hot-flag{
  width: 24px;height: 24px;display: inline-block;vertical-align: bottom;background-size: 100% ;background-repeat: no-repeat;
  background-image: url('../assets/homePage/hot.png');
}
/deep/ .haday-organization-tree{ 
  .el-tree-node.is-current>.el-tree-node__content .el-tree-node__label, 
  .el-tree-node__content:hover .el-tree-node__label{
    background: #3A8EE6 !important;
    color: #fff;
  }    
  div[role="treeitem"][aria-disabled="true"] >div.el-tree-node__content span.el-tree-node__label{
    background: inherit !important;
    cursor: text;
  } 
  .el-tree-node__expand-icon.is-leaf{color: #C0C4CC;}  
  .haday-org-close, .haday-org-title{border-color: #B3D8FF;}
  .el-tree__empty-text{color: #fff;}
  &:not(.haday-close-tree){width: 230px;}
}

.contextmenu {
  margin: 0;
  background: #fff;
  z-index: 3000;
  position: absolute;
  list-style-type: none;
  padding: 5px 0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  color: #333;
  box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
  z-index: 99999999;
  position: fixed;
}
.contextmenu li {
  margin: 0;
  padding: 7px 16px;
  cursor: pointer;
}
.contextmenu li:hover {
  background: #eee;
}
</style>